Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: What is the proper way to deal with Char v. Byte Semantics

by ncw (Friar)
on Jan 11, 2002 at 19:43 UTC ( [id://138028]=note: print w/replies, xml ) Need Help??


in reply to What is the proper way to deal with Char v. Byte Semantics

I have to say I had exactly the same problem trying to send UTF8 encoded XML stuff over HTTP (using Frontier::RPC2). Perl and me both got terribly confused over whether any given string was UTF8 or not.

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.

I experimented with 'use bytes' too but that didn't cut it either.

This code snipped might be useful

$unicode_perl = 1; { local $SIG{__DIE__}; eval "use utf8; 1" or $unicode_perl = 0; }
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://138028]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2024-04-16 09:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found