My problem is whenever I use XML in Perl everything gets converted to UTF-8, which is OK, as that is documented everywhere.
The docs also advise that you use utf to minimize any problems with UTF-8 and Perl.
The authors must have been english-speaking!
My language (danish) uses three not-uncommon (in danish that is) letters: æ, ø and å, that in the characterset we normally use (ISO-8859-1) are 8 bits long. In UTF-8 they are 16-bit characters. Any attempt to use them, in eg. a comment, results in syntax errors from perl. Whats more any data that we read from a file, or want to output to a file should be in ISO-8859-1 or it will be gibberish.
The way out has been to avoid use utf; and instead convert from UTF-8 to ISO-8859-1 everywhere data is fetched from XML, preferably by subclassing the XML-modules.
This is clunky, and errorprone.
Presently I sit and wait for Perl6 with line disciplines, and a new version of the operation system, that allows us to switch to UTF-8 (just leaving us with the minor task of converting all our data and files ;-)
Is there a monk out there who has another (preferably better - but I'm not picky) way of doing it?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.