perl-unicode

RE: converting between utf8 and bytes

2000-07-03 02:46:31
I second that. One needs to be able to say: "this
scalar contains utf8 already - treat it like that".

And for readability I'd prefer some "bless ($s, utf8)"
like thing to a clever pack/unpack scheme. My $0.02

Stefan
se(_at_)acm(_dot_)org

-----Original Message-----
From: Bart Schuller [mailto:schuller(_at_)lunatech(_dot_)com]
Sent: Monday, July 03, 2000 11:02 AM
To: perl-unicode(_at_)perl(_dot_)org
Subject: Re: converting between utf8 and bytes


On Mon, Jul 03, 2000 at 10:34:17AM +0900, 
simon(_dot_)p(_dot_)cozens(_at_)jp(_dot_)pwcglobal(_dot_)com wrote:
I have an XS module which I've been meaning to put onto CPAN which
just flicks on the SvUTF bit on a variable. That'll do what you want
but it's a sick and disgusting hack.

I don't think it's sick, it's exactly what you need if you are reading a
binary protocol that uses utf8 for strings. The filehandle as a whole
needs to be bytary, but depending on the data you might decide that a
substring needs to be tagged as utf8.

-- 
The idea is that the first face shown to people is one they can readily
accept - a more traditional logo. The lunacy element is only revealed
subsequently, via the LunaDude. [excerpted from the Lunatech 
Identity Manual]

<Prev in Thread] Current Thread [Next in Thread>