2009-12-02 99 views
0

我如何使我的网站unicode兼容,以支持除英语以外的其他语言。PHP:使网站Unicode兼容

感谢

+0

你只需要使用Unicode字符编码。而已。 – Gumbo 2009-12-02 06:05:37

+0

仅供参考,请勿多次提出同一问题。 – 2009-12-02 06:05:59

回答

1

对于PHP:

所有你需要设置编码为utf8脚本的第一个(集成开发环境/像Eclipse/Notepass ++或编辑用Ultraedit能够这样)。如果你会输出xhtml,那么你可能会添加:

<?xml version="1.0" encoding="utf-8"?> 
<html> 
    <head> 
     <meta http-equiv="content-type" content="application/xhtml+xml;charset=utf-8" /> 
    </head> 

强制浏览器使用utf8。

如果youre与示例XML文档,数据库(其中许多是支持UTF8)或不UTF8比看看PHP文档在下面的转换功能的任何其他来源的工作:

​​

这里的链接,文档:

http://www.php.net/manual/en/function.utf8-decode.php

http://www.php.net/manual/en/function.utf8-encode.php

http://www.php.net/manual/en/book.iconv.php

作为补充的尝试:

http://de.php.net/manual/en/book.mbstring.php