Martin Duerst wrote:
in 5.6 and 5.8, but _in_principle_ the bytes pragma should tell Perl in
both 5.6 and 5.8 that "I want bytes, darn it."

But you still get into problem when you pass UTF-8 flagged variables to legacy modules without the pragma.


Yes, that seems to do the job. But is this available in 5.0 or earlier?
Or is it possible to write some little code at the start that says
something like:

With Locale::Messages::turn_utf_8_off() you can portably turn the UTF-8 flag off on scalars (works with Perl 5.00?-5.8) and force byte-wise processing of that scalar globally.


By the way, the code I use for Perl 5.6 to turn the flag off looks like this:

sub turn_utf_8_off
{
        use bytes;
        $_[0] = join '', split //, $_[0];
}

Is there anything faster available for Perl 5.6 then doing the join/split?

Ciao

Guido
--
Imperia AG, Development
Leyboldstr. 10 - D-50354 Hürth - http://www.imperia.net/



Reply via email to