Re: [PHP] mb_convert_encoding converting to ASCII instead of UTF-8

2008-04-23 Thread Robert William Vesterman
I wasn't saying I was /telling/ it to go from UTF-8 to ASCII. I was saying it /was/ going from UTF-8 to ASCII, despite the fact that I was telling it to go from UTF-8 to UTF-8. And as noted previously in this thread, it turned out to be because mb_detect_encoding was /mistakenly/ detecting it

Re: [PHP] mb_convert_encoding converting to ASCII instead of UTF-8

2008-04-23 Thread tedd
At 11:28 AM -0400 4/23/08, Robert William Vesterman wrote: A little additional info: The "ASCII to ASCII" case for "Minnie=Mouse" is merely because the UTF-8 encoding for "Mouse" is the same as the ASCII encoding for "Mouse", and mb_detect_encoding is matching on ASCII before UTF-8. So that'

Re: [PHP] mb_convert_encoding converting to ASCII instead of UTF-8

2008-04-23 Thread Robert William Vesterman
And the culprit is that mb_detect_order() wasn't set up to handle ISO-8859-1. It was "ASCII, UTF-8". Changing it to "ASCII, UTF-8, ISO-8859-1" makes everything work as expected. Robert William Vesterman wrote: OK, now the problem seems to be not that mb_convert_encoding is encoding incorrect

Re: [PHP] mb_convert_encoding converting to ASCII instead of UTF-8

2008-04-23 Thread Robert William Vesterman
OK, now the problem seems to be not that mb_convert_encoding is encoding incorrectly, it's that mb_detect_encoding is detecting incorrectly. It's claiming that the raw string as received from the browser is UTF-8, where in reality it seems to be ISO-8859-1. Sample code: Minnie echo

Re: [PHP] mb_convert_encoding converting to ASCII instead of UTF-8

2008-04-23 Thread Eric Butera
On Wed, Apr 23, 2008 at 10:40 AM, Robert William Vesterman <[EMAIL PROTECTED]> wrote: > I've run into a problem where mb_convert_encoding seems to be converting to > ASCII, even though I'm telling it to convert to UTF-8. This is with PHP > version 4.3.11. > > I had been asking it to convert from

Re: [PHP] mb_convert_encoding converting to ASCII instead of UTF-8

2008-04-23 Thread Robert William Vesterman
A little additional info: The "ASCII to ASCII" case for "Minnie=Mouse" is merely because the UTF-8 encoding for "Mouse" is the same as the ASCII encoding for "Mouse", and mb_detect_encoding is matching on ASCII before UTF-8. So that's not an issue. But, the "UTF-8 to ASCII" case for "Minnie=M