doushantun0614 2016-02-13 04:34
浏览 72
已采纳

设置为charset = UTF8后,网页上未显示的特殊字符

I have an app that developed with JS, PHP and for some reason it is not able to display the Spanish Accents in the dropdown box which the values are from the mysql table. For the same app, it display those Spanish accents without any problem on the windows web server IIS 8.5, but not in the Linux box which running REL 6.5 with apache 2.2 installed.

Here are what I did try and checked.

The charset=UTF-8 already set in the meta header in the html. The php.ini on both servers are set default to UTF-8

Default charset for Apache config file is set to UTF-8.

Checked the locale setting on Linux box to make sure include the es-UTF8 in the sysconfig.

Checked the chrome dev tool by inspect the response header and the content-type showing plain/html , charset=UTF-8, vary: accept encoding.

If I go into the phpMyAdmin and look at the raw table, the accents are stored in the MySQL table and I can search it too inside phpMyAdmin.

  • 写回答

1条回答 默认 最新

  • dongxiao3694 2016-02-13 05:06
    关注

    Run below query before executing actual query:

    mysqli_query($con, 'SET names UTF8');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型