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
From: Bart Schuller [mailto:schuller(_at_)lunatech(_dot_)com]
Sent: Monday, July 03, 2000 11:02 AM
Subject: Re: converting between utf8 and bytes
On Mon, Jul 03, 2000 at 10:34:17AM +0900,
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