duanqiu2064 2016-05-14 17:44
浏览 135
已采纳

特殊字符在浏览器中正确显示,但在phpMyAdmin中加扰

I have a php netbeans project. The encoding for the project is UTF-8. Special characters display correctly in the ide. (img 1)

I use phpmyadmin and the encoding for the entire database is utf8_unicode_ci (the column also shows this). (img 2)

I use mysqli to connect, and it doesn't make any diference if I call

set_caharset("utf8"); 

(img 3)

In the browser everything is ok (including searches with special characters): (img 4)
But in phpMyAdmin the text introduced through mysqli is scrambled (whilst text introduced manually is ok - id 13 in the picture) (img 5)

encoding problem phpmyadmin mysqli

What should I do to send text correctly in phpmyadmin.

[edit] Some more info. I don't know how to interpret or use this, bu this is what

SHOW VARIABLES LIKE 'character_set%'

displays.

Variable_name: Value
character_set_client: utf8mb4
character_set_connection: utf8mb4
character_set_database: latin1
character_set_filesystem: binary
character_set_results: utf8mb4
character_set_server: latin1
character_set_system: utf8
character_sets_dir: D:\Programe\XAMPP\mysql\share\charsets\

[edit2] Ok, it is something that is server related. I uploaded the same code that generated the database on a different server and everything is ok. Do you have any ideas where the problem could be?

  • 写回答

1条回答 默认 最新

  • doufei9805 2016-05-16 14:38
    关注

    It's resolved!

    I'm not sure how, because I made multiple modifications before testing. Where I edited:

    • on the front-page of phpmyadmin (localhost/phpmyadmin) under server colation I choose other types of utf8.

    • I had a different connection class for the setup where I didn't call: set_caharset("utf8");

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么