将项目从windows-1256转换为utf-8字符集,有什么正确的步骤? [英] Transform project from windows-1256 to utf-8 charset, what's the right steps?

查看:605
本文介绍了将项目从windows-1256转换为utf-8字符集,有什么正确的步骤?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个PHP& MySQL脚本使用windows-1256字符集,我现在想修改整个脚本使它完全建立在utf-8字符集上。从$ mysql DataBase到PHP文件。



这是正确的步骤是什么?注意:我在脚本(阿拉伯语)中使用非拉丁语。

解决方案

在数据库级别,请查看:





对于您的html页面,请使用 meta tag:

 < meta charset = utf-8 /> 

您也可以使用这个标题:php:

  header('content-type:text / html charset = utf-8'); 

或者您可能想看看完整的php-arabic解决方案:




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).

解决方案

On the database level, have a look at:

As for your html pages, use this meta tag:

<meta charset=utf-8 />

And you can also use this header from php:

header('content-type: text/html charset=utf-8');

Or you might want to have a look at complete php-arabic solution here:

这篇关于将项目从windows-1256转换为utf-8字符集,有什么正确的步骤?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆