php-i18n Digest 3 Sep 2002 10:13:45 -0000 Issue 122

Topics (messages 315 through 315):

Japanese/mbstring: mb_detect_encoding differnet in IE5 and N7
        315 by: Jean-Christian Imbeault

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
I don't know if this is a problem with PHP or with the browsers but I am 
observing different output of my PHP script depending whether I am using 
IE5.5-japanese or N7-english.

The script is:

echo "Current encoding is: ".mb_http_output()."<BR>";
echo "Current encoding is: ".mb_get_info("all")."<BR>";
echo "The encoding of name is ".mb_detect_encoding($_POST["name"])."<BR>";
mb_http_output("EUC-JP");


The output for IE5.5 is:

Current encoding is: pass
Current encoding is: Array
The encoding of name is EUC-JP

The output for N7 is:

Current encoding is: pass
Current encoding is: Array
The encoding of name is ASCII

I called this script from a form where I entered one single kanji (ai, 
love) in POST var name.

When entered from Netscape PHP recognize the input as ASCII when it 
should have been SJIS!

Why? How can I fix it?

Thanks,

Jc

PS The form was generated by PHP and I set the charset as follows:

<head
   <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
</head>

Also my settings for mbstring were:

Multibyte (Japanese) Support enabled
http input encoding translation enabled

mbstring.detect_order: auto
mbstring.func_overload: 0
mbstring.http_input: auto
mbstring.http_output: SJIS
mbstring.internal_encoding: EUC-JP
mbstring.substitute_character: no value

--- End Message ---

Reply via email to