将项目从 windows-1256 转换为 utf-8 字符集,正确的步骤是什么? [英] Transform project from windows-1256 to utf-8 charset, what's the right steps?
本文介绍了将项目从 windows-1256 转换为 utf-8 字符集,正确的步骤是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 PHP &使用 windows-1256 字符集的 MySQL 脚本,我现在想修改整个脚本使其完全建立在 utf-8 字符集上.从mysql数据库开始到PHP文件.
I got a PHP & MySQL script that use windows-1256 charset, I now want to modify the whole script make it completely built on utf-8 charset. starting from mysql DataBase to PHP files.
实现这一目标的正确步骤是什么??!!
what is the right steps to achive that's??!!
注意:我在脚本中使用非拉丁语(阿拉伯语).
Note: I use non-Latin language in script (Arabic language).
推荐答案
在数据库层面,看看:
对于你的 html 页面,使用这个 meta
标签:
As for your html pages, use this meta
tag:
<meta charset=utf-8 />
你也可以使用来自 php 的这个头文件:
And you can also use this header from php:
header('content-type: text/html charset=utf-8');
或者您可能想在此处查看完整的 php-arabic 解决方案:
Or you might want to have a look at complete php-arabic solution here:
这篇关于将项目从 windows-1256 转换为 utf-8 字符集,正确的步骤是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文