Anything larger than 0x1F_FFFF will take more than four bytes.

Anything larger than 0xF_FFFF_FFFF will take 13.

$ perl -MDevel::Peek -e'Dump(chr(0x7FFFFFFFFFFFFFFF))' SV = PV(0x5555770a3f00) at 0x5555770d2d50 REFCNT = 1 FLAGS = (PADTMP,POK,READONLY,PROTECT,pPOK,UTF8) PV = 0x5555770db6f0 "\xFF\x80\x87\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xB +F\xBF"\0 [UTF8 "\x{7fffffffffffffff}"] CUR = 13 LEN = 15

as I said I think byte := character is confusing, it's rather character := byte in the classic case.

Still no idea what you mean. Are you talking about something I said? In which case, you could point out which thing I said you find confusing?

oh, and the classic case is char ≡ byte ≡ smallest addressable unit. It has been all kinds of sizes, including 6, 8, 9, 16 and even 32 bits. (I personally worked on a system with a 16 bit byte extensively.) But we now have strings with elements that have a size larger than the smallest addressable unit. So the classic case is irrelevant.


In reply to Re^18: Seeking Perl docs about how UTF8 flag propagates (Terminology) by ikegami
in thread Seeking Perl docs about how UTF8 flag propagates by raygun

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.