「http://www.squirrelmail.jp/node.php?id=269」を参照
変更ファイル名
/usr/share/squirrelmail/functions/i18n.php
以下の部分を変更
----------------------------------------------------------------
332行目付近に追加
if ($squirrelmail_language == 'ja_JP') {
header ('Content-Type: text/html; charset=EUC-JP');
if (!function_exists('mb_internal_encoding')) {
echo _("You need to have PHP installed with the multibyte string function
enabled (using configure option --enable-mbstring).");
// Revert to English link has to be added.
// stop further execution in order not to get php errors on mb_internal_en
coding().
return;
}
if (function_exists('mb_language')) {
mb_language('Japanese');
}
mb_detect_order('ASCII,JIS,EUC-JP,UTF-8,SJIS');
mb_internal_encoding('EUC-JP');
mb_http_output('pass');
} elseif ($squirrelmail_language == 'en_US') {
header( 'Content-Type: text/html; charset=' . $default_charset );
} else {
----------------------------------------------------------------
483行目付近を変更
修正前
function japanese_charset_xtra() {
$ret = func_get_arg(1); /* default return value */
if (function_exists('mb_detect_encoding')) {
switch (func_get_arg(0)) { /* action */
case 'decode':
$detect_encoding = @mb_detect_encoding($ret);
if ($detect_encoding == 'JIS' ||
$detect_encoding == 'EUC-JP' ||
$detect_encoding == 'SJIS' ||
$detect_encoding == 'UTF-8') {
$ret = mb_convert_kana(mb_convert_encoding($ret, 'AUTO'), "KV");
}
break;
case 'encode':
$detect_encoding = @mb_detect_encoding($ret);
if ($detect_encoding == 'JIS' ||
$detect_encoding == 'EUC-JP' ||
$detect_encoding == 'SJIS' ||
$detect_encoding == 'UTF-8') {
$ret = mb_convert_encoding(mb_convert_kana($ret, "KV"), 'JIS', 'AUTO');
}
break;
case 'strimwidth':
修正後
function japanese_charset_xtra() {
$ret = func_get_arg(1); /* default return value */
if (function_exists('mb_detect_encoding')) {
switch (func_get_arg(0)) { /* action */
case 'decode':
$detect_encoding = @mb_detect_encoding($ret);
if ($detect_encoding == 'JIS' ||
$detect_encoding == 'EUC-JP' ||
$detect_encoding == 'SJIS' ||
$detect_encoding == 'UTF-8') {
$ret = mb_convert_kana(mb_convert_encoding($ret, 'ASCII,JIS,EUC-JP,UTF-8,SJIS'), "KV");
}
break;
case 'encode':
$detect_encoding = @mb_detect_encoding($ret);
if ($detect_encoding == 'JIS' ||
$detect_encoding == 'EUC-JP' ||
$detect_encoding == 'SJIS' ||
$detect_encoding == 'UTF-8') {
$ret = mb_convert_encoding(mb_convert_kana($ret, "KV"), 'JIS', 'ASCII,JIS,EUC-JP,UTF-8,SJIS');
}
break;
case 'strimwidth':
----------------------------------------------------------------
530行目付近を変更
修正前
case 'decodeheader':
$ret = str_replace("\t", "", $ret);
if (eregi('=\\?([^?]+)\\?(q|b)\\?([^?]+)\\?=', $ret))
$ret = @mb_decode_mimeheader($ret);
$ret = @mb_convert_encoding($ret, 'EUC-JP', 'AUTO');
break;
case 'downloadfilename':
$useragent = func_get_arg(2);
if (strstr($useragent, 'Windows') !== false ||
strstr($useragent, 'Mac_') !== false) {
$ret = mb_convert_encoding($ret, 'UTF-8', 'AUTO');
} else {
$ret = mb_convert_encoding($ret, 'EUC-JP', 'AUTO');
}
break;
修正後
case 'decodeheader':
$ret = str_replace("\t", "", $ret);
if (eregi('=\\?([^?]+)\\?(q|b)\\?([^?]+)\\?=', $ret))
$ret = @mb_decode_mimeheader($ret);
$ret = @mb_convert_encoding($ret, 'EUC-JP','ASCII,JIS,EUC-JP,UTF-8,SJIS');
break;
case 'downloadfilename':
$useragent = func_get_arg(2);
if (strstr($useragent, 'Windows') !== false ||
strstr($useragent, 'Mac_') !== false) {
$ret = mb_convert_encoding($ret, 'UTF-8', 'ASCII,JIS,EUC-JP,UTF-8,SJIS');
} else {
$ret = mb_convert_encoding($ret, 'EUC-JP', 'ASCII,JIS,EUC-JP,UTF-8,SJIS');
}
break;
2007/11/28
登録:
投稿 (Atom)