|Don't ask to ask, just ask|
Problem with join'ing utf8 and non-utf8 strings (bug?)by rsmah (Scribe)
|on Jun 17, 2008 at 17:09 UTC||Need Help??|
rsmah has asked for the wisdom of the Perl Monks concerning the following question:
I ran into a problem using XML::Simple generating output XML. The input hash was a mix of utf8 and non-utf8 strings. At the last stage, XML::Simple::XMLout join's components together and I get corrupted data.
I found this behavior very odd so I put together a test case that shows join corrupting a non-utf8 string when join'ed with another utf8 string.
At first I thought it might be decoding the non-utf8 string using the locale (or LANG or whatever) to some other encoding, but running this on a LANG=en_US.UTF-8 system produced the same results.
Can anyone explain to me what is going on?