in reply to perl unicode docs

The fact of the matter is, if the pattern switched to the Unicode character scheme then the pattern couldn't possibly match a single character in a UTF-8 string.

Why not?

If by "a single character" you mean a codepoint encoded it multiple bytes, then yes, that's the default mode.

If you by "a single character" you mean a byte of a multi-byte UTF-8 sequence, then yes, even that's possible (with the \C escape. Yes, it's... weird, but it is implemented). (But nowhere in the unicode docs I can find an indication that this is meant).

I think it would be nice if the person who wrote the perlunicode docs had adhered to the basic tenants of unicode when describing perl's state of unicode awareness.

And where did he not? By the way, if you find places where the docs need improvement, don't whine about it, but submit patches.

Or, was the idea to dumb down the docs and present factually incorrect descriptions so that beginners who think that Unicode characters are the same as UTF-8 characters are not confused?

I don't think so. I also don't see how anything of the docs is factually incorrect.

Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^2: perl unicode docs
by 7stud (Deacon) on Mar 27, 2010 at 13:09 UTC

    The fact of the matter is, if the pattern switched to the Unicode character scheme then the pattern couldn't possibly match a single character in a UTF-8 string.

    Why not?

    Because a Unicode character and a UTF-8 character are different entities. If the regex is looking for a Unicode character, the regex will never find one in a string that contains only UTF-8 characters.

    By the way, if you find places where the docs need improvement, don't whine about it, but submit patches.

    Wouldn't it be best to discuss proposed changes before submitting anything? In any case, I spent 7 yours one day trying to do just that--without success, and I will never, ever try to interface with that archaic system ever again.

    I don't think so. I also don't see how anything of the docs is factually incorrect.

    Well, you are smarter than me, so I guess that's the end of that.

      Because a Unicode character and a UTF-8 character are different entities.

      How so? What do you mean by "UTF-8 character"? I read that as "one Unicode character encoded in UTF-8", not as "one byte".

      Wouldn't it be best to discuss proposed changes before submitting anything?

      Yes. But that's not what your question sounded like. It sounded more like "is it just me, or were the original authors jerks?"

      I spent 7 yours one day trying to do just that--without success, and I will never, ever try to interface with that archaic system ever again.

      Now it would be interesting to here what you man by "that archaic system". The source control system is quite modern. The p5p list is another matter, but so far I never had problems getting doc patches applied.

      Perl 6 - links to (nearly) everything that is Perl 6.
Re^2: perl unicode docs
by 7stud (Deacon) on Mar 27, 2010 at 13:09 UTC
    double post