With use bytes turned off:

SV = PV(0x1c71c9e8) at 0x1c202710 REFCNT = 1 FLAGS = (PADMY,POK,pPOK,UTF8) PV = 0x1cab9940 "\0\0\3\302\261---\nCONTENT_LENGTH: [etc]

With use bytes turned on:

SV = PV(0xbfdd1e8) at 0xb734730 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0xbfeb710 "\0\0\3\261---\nCONTENT_LENGTH: [etc]

With use bytes turned off and with calling utf8::downgrade on the string before dumping:

SV = PV(0xd5ed9e8) at 0xd0d3710 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0xd98b100 "\0\0\3\261---\nCONTENT_LENGTH: [etc]

Calls to Encode::is_utf8 are also tracking those values as noted by the dump.

aHA.

Resorted to reading the code in pp_pack.c, discovered that the UTFness of a packed string appears to be based on the UTFness of its components (which makes sense). The second string I'm packing here came from the Net::Async::FastCGI::Request stdin data, and was UTF8-flagged. So the question turns into how to convince that module to forget about encodings in its I/O - the code I'm building here is just relaying bits from one place to another and shouldn't be touching them.


In reply to Re^2: use bytes vs packed data by RDOlson
in thread use bytes vs packed data by RDOlson

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.