From: tokul Date: Tue, 13 Dec 2005 10:53:43 +0000 (+0000) Subject: adjusting string functions to Japanese translation layout specifics X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=37780b3edb973c9dbb20c52e8c7dc1beb3b4f5bb adjusting string functions to Japanese translation layout specifics (#1377622). git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10461 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/strings.php b/functions/strings.php index 25525fab..0844117a 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -1174,9 +1174,10 @@ function sq_strlen($str, $charset=null){ // use automatic charset detection, if function call asks for it if ($charset=='auto') { - global $default_charset; + global $default_charset, $squirrelmail_language; set_my_charset(); $charset=$default_charset; + if ($squirrelmail_language=='ja_JP') $charset='euc-jp'; } // Use mbstring only with listed charsets @@ -1241,9 +1242,10 @@ function sq_str_pad($string, $width, $pad, $padtype, $charset='') { function sq_substr($string,$start,$length,$charset='auto') { // use automatic charset detection, if function call asks for it if ($charset=='auto') { - global $default_charset; + global $default_charset, $squirrelmail_language; set_my_charset(); $charset=$default_charset; + if ($squirrelmail_language=='ja_JP') $charset='euc-jp'; } $charset = strtolower($charset); if (function_exists('mb_internal_encoding') && @@ -1271,9 +1273,10 @@ function sq_substr($string,$start,$length,$charset='auto') { function sq_strpos($haystack,$needle,$offset,$charset='auto') { // use automatic charset detection, if function call asks for it if ($charset=='auto') { - global $default_charset; + global $default_charset, $squirrelmail_language; set_my_charset(); $charset=$default_charset; + if ($squirrelmail_language=='ja_JP') $charset='euc-jp'; } $charset = strtolower($charset); if (function_exists('mb_internal_encoding') && @@ -1299,9 +1302,10 @@ function sq_strpos($haystack,$needle,$offset,$charset='auto') { function sq_strtoupper($string,$charset='auto') { // use automatic charset detection, if function call asks for it if ($charset=='auto') { - global $default_charset; + global $default_charset,$squirrelmail_language; set_my_charset(); $charset=$default_charset; + if ($squirrelmail_language=='ja_JP') $charset='euc-jp'; } $charset = strtolower($charset); if (function_exists('mb_strtoupper') &&