dongshou1991 2013-07-23 15:32
浏览 51

获取列名时无法显示土耳其语字符

I'm trying to get column names with Turkish characters. Here is the code.

$cekelim=mysql_query("SELECT * FROM kategori");
$sayisi=mysql_num_fields($cekelim);
for($i=0;$i<$sayisi;$i++){
$listeleyelim=mysql_field_name($cekelim,$i);
echo $listeleyelim."<br>";
}

And I used these codes in the beginning of php file

mb_internal_encoding('UTF-8');
mysql_query('SET NAMES UTF8');
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET COLLATION_CONNECTION = 'utf8_turkish_ci'");

And also I used

<meta http-equiv='Content-Type' content='text/HTML; charset=utf-8' />

between head tags in html.

Edit1:

Adding

header('Content-Type: text/html; charset=ISO-8859-9');

fixes ü and ö but doesn't work for only-in-Turkish characters.

Edit2:

I replaced all Turkish characters with numerical codes such as &#231 and I'm replacing all Turkish characters with numerical codes when inputting a new column. This is not the exact way I was looking for but this alternate way works fine.

  • 写回答

1条回答 默认 最新

  • douweng9427 2013-07-23 15:46
    关注

    Use header to modify the HTTP header:

    <?php
    header('Content-Type: text/html; charset=utf-8');
    

    Or:

    header('Content-Type: text/html; charset=ISO-8859-9');
    
    评论

报告相同问题?

悬赏问题

  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上