dongya5893 2015-09-03 08:05 采纳率: 100%
浏览 88

用于中文文本的php utf-8编码

I am doing migration to generate SQL from one DB to another.

I am trying to get the output enter image description here

But when I did a mb_convert_encoding("Mr.Wang (王老板)", 'UTF-8', 'Windows-1252')

I have the output as enter image description here

I have those two extra "box". Any idea what am I doing wrong?

phpMyAdmin is able to export my old database containing chinese text in correct format, how do it do that in script?

*updated the images to better show my view

  • 写回答

2条回答 默认 最新

  • dqef7931 2015-09-03 08:13
    关注

    Have you tried setting the header in the script to UTF8? What I normally use is the following:

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

    That has worked for me so far for German characters & some Arabic & Japanese etc.

    评论

报告相同问题?

悬赏问题

  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python