note
ncw
I have to say I had exactly the same problem trying to send
UTF8 encoded XML stuff over HTTP (using [CPAN://Frontier::RPC2]). Perl and me both got terribly confused over whether any given string was UTF8 or not.<P>
This ended up being a complete nightmare especially since this code had to work on 5.5 and 5.6. In the end I worked out that something in Frontier::RPC2 was converting my strings to UTF8 behind my back under 5.6 whereas I had to convert them by hand in 5.5.<P>
I experimented with 'use bytes' too but that didn't cut it either.<P>
This code snipped might be useful
<code>
$unicode_perl = 1;
{ local $SIG{__DIE__}; eval "use utf8; 1" or $unicode_perl = 0; }
</code>
Altogether a very unpleasant experience which makes me think that 5.6 isn't really ready for UTF :-( Maybe 5.8 will be better in this regard.
137977
137977