Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14041 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21870 invoked by uid 1010); 10 Dec 2004 22:19:53 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 15739 invoked from network); 10 Dec 2004 22:19:06 -0000 Received: from unknown (HELO ybbsmtp13.mail.mci.yahoo.co.jp) (210.80.241.187) by pb1.pair.com with SMTP; 10 Dec 2004 22:19:06 -0000 Received: from unknown (HELO ?192.168.1.122?) (219.180.130.6 with poptime) by ybbsmtp13.mail.mci.yahoo.co.jp with SMTP; 10 Dec 2004 22:19:05 -0000 X-Apparently-From: X-yjpVirusScan: Scanned Received: from 127.0.0.1 (AVG SMTP 7.0.289 [265.4.7]); Sat, 11 Dec 2004 07:19:03 +0900 Date: Sat, 11 Dec 2004 07:19:03 +0900 To: Al Baker Cc: internals@lists.php.net In-Reply-To: <1102190520.12784.30.camel@localhost> References: <1102190520.12784.30.camel@localhost> Message-ID: <20041211071035.710C.RUI_HIROKAWA@ybb.ne.jp> X-Mailer: Becky! ver. 2.11.02 [ja] Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=US-ASCII Subject: Re: [PHP-DEV] mbstring internal encoding behavior From: rui_hirokawa@ybb.ne.jp (Rui Hirokawa) Japanese multibyte encoding and Unicode, and some singlebyte encodings are supported by mbstring up to PHP 4.2.x. =46rom 4.3.x, the Korean and Chinese multibyte encoding are also supported, and the language setting is introduced. You should define mbstring.language in php.ini, mbstring.language =3D Japanese; for Japanese encoding like Shift_JIS mbstring.language =3D Korean; for Korean encoding It affects the automatic encoding detection of the user input (POST/GET/Cookie) and the default encoding. Rui On Sat, 04 Dec 2004 15:01:59 -0500 Al Baker wrote: > I've noticed some different behavior between mbstring versions 4.2.2 and > 4.3.9 -- both on RedHat 8 -- in terms of how internal encoding affects > the script. >=20 > In 4.2.2, the encoding translation appeared to work okay and would > convert Shift_JIS into UTF-8 on incoming requests. We didn't try any > other encodings since this was our primary concern and worked well. The > internal_encoding setting in the php.ini file was set to UTF-8. Our > language file (very simple PHP array with values being the translated > text) was in Shift_JIS, and this was no problem to just send this to the > browser. We display send the Shift_JIS language file entries to the > browser [via Smarty] as well as some other text that is stored in UTF-8 > and run through mb_convert_encoding to convert it to Shift_JIS as well. > All in all, this works as expected. >=20 > Now, we're trying to upgrade to php4.3.9 and I can find no easy way to > get the Shift_JIS to work.... in the existing setup, it would just > return UTF-8 or garbled characters. In other words, mb_convert_encoding > was not doing it's job, and it wouldn't even display the Shift_JIS > language file entries. Manually converting the language file from > Shift_JIS characters to UTF-8 and then running all the elements through > mb_convert_encoding apparently did nothing as well -- unless I first > called mb_internal_encoding() and set that to Shift_JIS (likewise, > setting this in the php.ini file worked as well). Then, the characters > would be displayed correctly in Shift_JIS. I'm not sure if this is the > correct behavior though... it seems to me that the internal encoding > should almost always be UTF-8 and mb_convert_encoding should work > regardless of the internal encoding. =20 >=20 --=20 Rui Hirokawa -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.289 / Virus Database: 265.4.7 - Release Date: 2004/12/07