Re: Continuing Perl 5.8.0 Problems
by Steve Hay other posts by this author
Oct 2 2002 3:52PM messages near this date
view in the new Beta List Site
Re: Continuing Perl 5.8.0 Problems
|
Re: Continuing Perl 5.8.0 Problems
Petr Pajas wrote:
> Steve Hay <steve.hay@[...].com> writes:
>
> >There don't appear to be any "official" functions to turn off the
> >UTF-8
> >flag. The other functions in the Encode module are for converting
> >data to/from different encodings; the data in question here is already
> >encoded in UTF-8 -- I'm only fiddling with whether or not it is
> >"flagged" as such.
> >
> >
> i don't agree. having a non-flagged octet in utf-8 encoding, you may
> use decode('utf8',$string) to make it proper Perl 5.8 utf-8 encoded
> string.
>
>
The Encode manpage says that the returned string will have the UTF-8
flag *on* unless the supplied string consists entirely of ASCII data,
which in my example it doesn't.
Thus,
$str = decode('utf8', $str);
does *not* turn off the UTF-8 in $str when $str contains non-ASCII data.
The only way I found to turn it off for sure is to use the _utf8_off()
function.
Out of desperation, I tried this suggestion anyway and found that it
makes things even worse! I now get some data that was not previously
flagged as UTF-8 being flagged, followed by Perl crashing with a nasty
Windows Popup Error -- something that I never managed to induce using
the risky "internal" function!
- Steve
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Steve Hay
Steve Hay
Robin Berjon
Steve Hay
Petr Pajas
Robin Berjon
Steve Hay
Petr Pajas
|