That sounds like a problem where your sent string is implicitely converted from UTF-8 into Latin-1 when sent over the socket (that can only happen in perl 5.8.x and later), and the conversion fails because some character's code is 256 or above. And that is when you get that warning.
On standard filehandles, the solution is typically to use binmode with the ":utf8" as a second parameter, making it skip the conversion away from UTF8, and send the UTF-8 characters, sometimes two or three bytes per character. Perhaps that may work on sockets too, it's worth a try.
The other option is making the string not UTF-8 yourself. You can use the Encode::Encoder module, converting into any single byte character set you like.
There are some tricks one can pull using pack, so you can keep the UTF8 bytes, and still make perl thinks it is raw bytes.
$raw = pack "C0a*", $utf8;
You can achieve the same effect, using the
_utf8_off() function from
Encode, telling perl that "this is not an UTF8 string".
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.