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 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了