At 13:22 +0900 02.7.11, 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?
You've converted the encoding from EUC to SJIS inside the script and then the entire output buffer gets converted from EUC (assumed since that's what internal encoding is set to) to SJIS, trying to convert that SJIS strirng from EUC to SJIS, resulting in a mess. You've set things up for encoding conversion to happen automatically, so you don't need to mess with it by doing things like mb_convert_encoding($test, "SJIS","EUC-JP");. > >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 > > > >-- >PHP Internationalization Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Internationalization Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php