2009-12-02 103 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