PHPheader('Content-type: text/html; charset=utf-8');
を設定する必要がありますか
AddDefaultCharset utf-8
<IfModule mod_mime.c>
AddCharset utf-8 .php .html .xml .css .js .json
</IfModule>
.htaccess-file で定義されていますか? .php ファイルもこのルールの影響を受けますか?
私はsettings.cfg.php
-document を設定していますが、このコード行が本当に必要かどうか疑問に思っています。
必須ではないことはわかっていますが、エンド ユーザーは Apache サーバーの設定を変更するアクセス権がないため<meta charset="utf-8">
、ドキュメントに残すことを強くお勧めします。index.php
しかし、それはクライアント側のコンテンツにのみ影響し、PHPによってサーバー側から作成されたフェッチされたコンテンツには影響しません-それが意味をなす場合...
編集: ここに私の index.php があります:
load.initialize.phpには、一番上に私の settings.cfg.php ドキュメントが必要です...
<?php require_once 'initialize/load.initialize.php'; ?>
<!DOCTYPE html>
<head>
<meta charset="utf-8">
...
</head>
<body>
<!--
this document includes page -header, -navigation, -content and -footer,
where the content-part is just including other .php content pages or fetching content from database.
-->
<?php require 'template/load.template.php'; ?>
</body>
</html>