On Mon, 14 Jul 2003, Andy Hassall wrote:
[tv_grab_de problems]
>>Perhaps 'use bytes' is the right solution after all.
>
>Isn't the 'more correct' way to ensure that the locale is set to a
>Latin1-based (or at least, not UTF-8) locale before running Perl?
I think locale is for communication to and from the user. At a pinch,
you could assume it also gives the encoding for the user's text
files. But it doesn't seem right to use it to indicate the encoding
of some random XML document downloaded off the Web.
>'use bytes' patches up the problem by treating everything as binary,
>basically, which seems a bit hackish for a text processing program.
It does the job, though, since iso8859-1 is a single-byte
encoding. The XML file has an explicit encoding marker at the start,
so if we wanted to treat it as text in a particular encoding we still
could.
>Looks like the Perl developers have decided the automagic-UTF8 was a
>bad idea; it's been reversed in 5.8.1.RC2.
In that case it's not worth looking for a cleaner solution than 'use
bytes'.
--
Ed Avis <ed@xxxxxxxxxxx>
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
|