0

PHPLIST的服务器上有编码日文字体的卡。

我安装了外语包,但仍然无法编码SHIFT-JISUTF-8.

如何使用编码定义行更正文件中的 PHP 编码以更正 PHP 制作的每个页面中的编码?

我认为问题在于程序的脚本没有为每个页面定义编码,因为程序版本的编码更正

4

1 回答 1

-1

2 possible source of problems: PHP script itself and database at the back (if any).

By sending the approiate header before any content has been sent to the client (simply speaking, headers must be sent at the beginning of your code as possible), the encoding could be "defined" by

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

EDIT!

Esailija gave a review and correction (see comments below) on my answer which is not correct for your question. As suggested by Esailija, you should check transmission encoding instead on the storage encoding itself.

My original answer is kept here as a "hall of shame".

Note that if you are using DBMS like MySQL, the encoding in the database should be set properly as well (utf8_general_ci recommended, backup your data completely before you applying any changes to the existing data and do it on an independent testing server first, as changing the encoding in your database could be a disaster).

于 2013-04-20T07:16:39.747 回答