I have been pulling my hair out for a few days on this. We have a Perl 5.6 system (yes, 5.8 would be much better but I am stuck with this for the moment).

We are using Frontier::Client (which uses LWP::UserAgent) to send utf-8 data to another system. My data _is_ utf-8, but when it hits the wire (using tcpdump) the 4 byte unicode characters are now 8 bytes and cannot be properly decoded on the receiving system.

The string I am handing to syswrite seems fine. The socket is, well, a socket. Syswrite returns the number of bytes I would expect to be sent. 'use bytes' is in scope. I can't think of any reason why this would be happening.

Any insight would be greatly appreciated. Thank you.


In reply to Writing utf-8 to a socket with syswrite in perl 5.6 by Anonymous Monk

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.