Accidentally, you'll get 65 for uppercase input, but not for the reason it seems you expect (which seems "a plain letter of any case followed by zero-width combining diaeresis". You didn't provide Perl with such input, nor you should as other answers have already pointed out, and rarely can, but see further). It just happens, that among 6 octets of utf-8 encoded input, the latter of the pair representing uppercase "Ü" ("\xC3\x9C") belongs to 0x80..0x9F range, which Unicode::GCString considers to have zero width. A few others of utf-8 encoded extended Latin would also demonstrate "false positive" "correct" result. But not lowercase "ü" -- either "alas" or "luckily" depends on viewpoint.

For correct but unnecessary "plain letter followed by combining diaeresis" and expected 2 unequal numbers output, your input could have contained "u\x{0308}", or NFD "\N{U+00fc}", or NFD 'ü' under use utf8;, or NFD "\N{LATIN SMALL LETTER U WITH DIAERESIS}", etc. For reverse cure, assuming it's required at all on top of correct decoding, I'd expect Unicode::Normalize::NFC to be of use but Unicode::GCString unnecessary for simple plain or extended Latin, but YMMV.


In reply to Re: incorrect length of strings with diphthongs by vr
in thread incorrect length of strings with diphthongs by tos

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.