文字化けの解決法はないでしょうか?
投稿者: nosumi | 投稿日時: 2009-3-27 16:21 | 閲覧: 3479回
次のような環境で構築しましたが、文字化けします。
解消法をご存知の方がいらっしゃったら、お教えください。
------------------------------------------------
環境
ハード : HP ML150 G5
OS : Windows Server 2003 Stunderd edition
Web : Apache 2.2.11
PHP : PHP 5.2.9
DB : MySQL 4.1.22 (Ver5ではうまくいきませんでした。)
設定内容
・php5ts.dll c:/phpからc:/windows/system32へコピー
・php.ini c:/phpからc:/windowsにコピー
・php.iniの修正内容
output_buffering = On
output_handler = mb_output_handler
magic_quotes_gpc = Off
default_charset = "Shift_JIS"
extension_dir = "c:/php/extensions"
extension=php_mbstring.dll
mbstring.language = Japanese
mbstring.internal_encoding = EUC-JP
mbstring.http_input = auto
mbstring.http_output = SJIS
mbstring.encoding_translation = On
mbstring.detect_order = auto
mbstring.substitute_character = none;
extension=php_mysql.dll
mysql.default_host = localhost
mysqli.default_host = localhost
・httpd.cofの修正内容
DirectoryIndex index.html index.htm index.cgi index.php
LoadModule php5_module c:/php/sapi/php5apache2_2.dll ・・・追加
AddType application/x-httpd-php .php ・・・追加
AddType application/x-httpd-php-source .phps ・・・追加
PHPIniDir "C:/windows" ・・・追加
AddDefaultCharset shift_jis
DocumentRoot "c:/www/html"
括弧Directory "c:/www/html"括弧
・my.iniの修正内容
[mysqld]
default-character-set=sjis
[mysql]
default-character-set=sjis
・libmysql.dll c:/phpからc:/windows/system32へコピー
・環境変数はPHP、MySQLとも設定済
XOOPSのインストール時
・HTMLの配下をコピー
・extras/extra_languages/ja_utf8/html配下を上書きコピー
・上記以外のlanguagesのある箇所には「japanease」フォルダをコピーして「ja_utf8」フォルダをつくり、
中の漢字のあるファイルをutf8に変換
・インストールダイアログ「ja-utf8」指定
XOOPSインストール後UTF8未対応モジュールインストール時
・languagesのある箇所には「japanease」フォルダと同列で「ja_utf8」作成 (コード変換済)
----------------------------------------------------------
【トラブル状況】
1.全て漢字が正しく表示されるが、管理メニュー>互換モジュール>モジュールの管理で「アップデート」をクリック時に
モジュール名が文字化けします。
2.管理メニューの互換モジュールの全般設定の使用言語で「japanease」に変更
これを行えば、管理者メニューへ切り替えるときなどに表示する「・・・さん、ようこそ。ログイン処理中です。 ・・・」等が
文字化けします。 (当然でしょうが。)
どちらかでの解決策がないかと模索中です。
解消法をご存知の方がいらっしゃったら、お教えください。
------------------------------------------------
環境
ハード : HP ML150 G5
OS : Windows Server 2003 Stunderd edition
Web : Apache 2.2.11
PHP : PHP 5.2.9
DB : MySQL 4.1.22 (Ver5ではうまくいきませんでした。)
設定内容
・php5ts.dll c:/phpからc:/windows/system32へコピー
・php.ini c:/phpからc:/windowsにコピー
・php.iniの修正内容
output_buffering = On
output_handler = mb_output_handler
magic_quotes_gpc = Off
default_charset = "Shift_JIS"
extension_dir = "c:/php/extensions"
extension=php_mbstring.dll
mbstring.language = Japanese
mbstring.internal_encoding = EUC-JP
mbstring.http_input = auto
mbstring.http_output = SJIS
mbstring.encoding_translation = On
mbstring.detect_order = auto
mbstring.substitute_character = none;
extension=php_mysql.dll
mysql.default_host = localhost
mysqli.default_host = localhost
・httpd.cofの修正内容
DirectoryIndex index.html index.htm index.cgi index.php
LoadModule php5_module c:/php/sapi/php5apache2_2.dll ・・・追加
AddType application/x-httpd-php .php ・・・追加
AddType application/x-httpd-php-source .phps ・・・追加
PHPIniDir "C:/windows" ・・・追加
AddDefaultCharset shift_jis
DocumentRoot "c:/www/html"
括弧Directory "c:/www/html"括弧
・my.iniの修正内容
[mysqld]
default-character-set=sjis
[mysql]
default-character-set=sjis
・libmysql.dll c:/phpからc:/windows/system32へコピー
・環境変数はPHP、MySQLとも設定済
XOOPSのインストール時
・HTMLの配下をコピー
・extras/extra_languages/ja_utf8/html配下を上書きコピー
・上記以外のlanguagesのある箇所には「japanease」フォルダをコピーして「ja_utf8」フォルダをつくり、
中の漢字のあるファイルをutf8に変換
・インストールダイアログ「ja-utf8」指定
XOOPSインストール後UTF8未対応モジュールインストール時
・languagesのある箇所には「japanease」フォルダと同列で「ja_utf8」作成 (コード変換済)
----------------------------------------------------------
【トラブル状況】
1.全て漢字が正しく表示されるが、管理メニュー>互換モジュール>モジュールの管理で「アップデート」をクリック時に
モジュール名が文字化けします。
2.管理メニューの互換モジュールの全般設定の使用言語で「japanease」に変更
これを行えば、管理者メニューへ切り替えるときなどに表示する「・・・さん、ようこそ。ログイン処理中です。 ・・・」等が
文字化けします。 (当然でしょうが。)
どちらかでの解決策がないかと模索中です。
コメント(3)
新しいものから |
古いものから |
ネスト表示 |
Re: 文字化けの解決法はないでしょうか?
Re: 文字化けの解決法はないでしょうか?
投稿者: Marijuana | 投稿日時: 2009-3-27 19:11
XCLをutf8で使うのに
> default_charset = "Shift_JIS"
> mbstring.http_output = SJIS
なんでsjisなの?
> mbstring.internal_encoding = EUC-JP
なんでここだけEUC-JP?
php.iniなんてググればいくらでも出てくるでしょ
> AddDefaultCharset shift_jis
ここもなんでsjis
> default-character-set=sjis
> default-character-set=sjis
ここもなんでsjis
utf8ならutf8で全部統一すればいいだけじゃん?
文字コードをデタラメに設定する理由でもあるの?
> default_charset = "Shift_JIS"
> mbstring.http_output = SJIS
なんでsjisなの?
> mbstring.internal_encoding = EUC-JP
なんでここだけEUC-JP?
php.iniなんてググればいくらでも出てくるでしょ
> AddDefaultCharset shift_jis
ここもなんでsjis
> default-character-set=sjis
> default-character-set=sjis
ここもなんでsjis
utf8ならutf8で全部統一すればいいだけじゃん?
文字コードをデタラメに設定する理由でもあるの?
Powered by Plugg


