in reply to Wide character problem using Socket.pm
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.
You can achieve the same effect, using the _utf8_off() function from Encode, telling perl that "this is not an UTF8 string".$raw = pack "C0a*", $utf8;
|
|---|