Where comes the conflict with locales from?
There are many aspects to locale, but one of them is a mapping of integers to characters. But that's what Unicode does as well: in its heart, it maps integers to characters.

Perl strings are a little bit more sophisticated than C strings, but all this sophistication is only on a technical level. But Perl strings are still pretty dumb: they're a sequence of integers.

The problem comes when we consider a string that doesn't have the UTF-8 flag set (which is not only used internally - to tell how the integers mentioned above are encoded in bytes, but it's also signalling Unicode semantics apply). Suppose one of the integers of the string is 0xDF. Which character is it? Is it a letter? A number? Something else?

Do I miss something in my understanding?
Experts consider locale-support to be broken in Perl. Some of them are itching to declare them deprecated. Bugs are considered to complicated to fix.

If you think there's an easy fix to get things working better than they are now, I'd think p5p would be quite interested in your patches.


In reply to Re: Locale and Unicode, enemies in perl? by JavaFan
in thread Locale and Unicode, enemies in perl? by andal

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.