Re: Re: mbstring: Japanese: encoding conversion not

From: Date: Fri, 12 Jul 2002 08:29:27 +0000
Subject: Re: Re: mbstring: Japanese: encoding conversion not
References: 1 2 3 4 5 6 7 8 9 10 11 12  Groups: php.i18n 
Request: Send a blank email to php-i18n+get-294@lists.php.net to get a copy of this message
Jean-Christian Imbeault wrote:
David Emery wrote:
There's more, and this is the biggie... '--enable-mbstring-enc-trans' should be '--enable-mbstr-enc-trans'
That fixed most of my problems! Thanks! Now I just have a question concerning the use of "internal encoding". When I receive $test it is in EUC-JP (because I have internal encoding set to EUC-JP?). If I echo $test back to the browser it comes out as SJIS. This is all good. But if I do this: echo(mb_convert_encoding($test, "SJIS","EUC-JP")); I get mojibake. Why? $test is internally encoded in EUC-JP and I want to spew it back out as SJIS and I have mbstring.http_output set to SJIS, so why won't it print properly?
If you would like to output SJIS when you are using EUC-JP as internal encoding, you shouldn't try to output SJIS encoding to browser. It will result in mojibake. Only use EUC-JP. Output buffer mechanism will buffer all output , including EUC-JP encoding text, then convert it SJIS in your setting. Use mb_convert_encoding and mb_convert_variables when you are reading text file or like. (And multipart/form-data, since mbstring will not try to convert encoding automatically when multipart/form-data form encoding is used) -- Yasuo Ohgaki
Thanks for all the help so far! Things seem to be working fine now. It's just my understanding that is a flaky I think. If I can get to understand the purpose/use of the settings and functions it will go a long way in preventing future errors on my part ^_^ Jc


« previous php.i18n (#294) next »