Re: Problem with Shift_JIS script encoding

From: Date: Fri, 23 Jul 2004 08:38:22 +0000
Subject: Re: Problem with Shift_JIS script encoding
References: 1  Groups: php.i18n 
Request: Send a blank email to php-i18n+get-737@lists.php.net to get a copy of this message
1. My scripts are all written in Shift_JIS
Meaning: 1) your scripts contain Japanese messages and you used Shift_JIS in your text editor, and/or 2) these scripts display in the browser with the charset explicitly set to Shift_JIS. Correct? OK.
Yes, that's it.
2. When I try to send mail using the mb_send_mail function, the messages written in my scripts in Shift_JIS are not properly encoded (it appears that PHP thinks that the code is in EUC and is making an incorrect conversion).
Do you really need to use EUC-JP for your application? We're also using only Shift_JIS, and successfully.
No, I don't. It just appeared from the documentation and what I saw online that the internal_encoding should be set to EUC. However, I went and changed the internal_encoding to Shift_JIS and it seems to work. Any idea if this is a good or bad idea?
More importantly I think, do you set mb_language? Try this: echo mb_language(); If it returns false, then set it to "Japanese" before sending your mail.
Thanks for the tip. Right now, with the internal_encoding set to Shift_JIS, I don't have the problem any more; however, I'll give it a try if I'm encouraged not to use Shift_JIS for the internal_encoding. Thanks again!

« previous php.i18n (#737) next »