Martin J. Evans <[EMAIL PROTECTED]> writes:
>I have a module based on IO::Socket::INET which has a method which 
>should be able to send UTF-8 across the socket. When I call the method 
>with a UTF-8 string it does a:
>
>print $sock $string
>
>where $sock was returned by IO::Socket::INET and $string contains UTF-8 
>characters. I get a warning:
>
>Wide character in print at ESXMLODBC/XMLREQUEST.pm line 254.
>
>How do I make the default encoding on the socket UTF-8 in the same way 
>as you do with file handles (e.g. open(my $fh,'>:utf8', 'anything') or 
>binmode (FH, ":utf8"))?

A socket is a file handle so :

binmode($sock,":utf8");

should work.

>
>I'm using Perl 5.8.0.
>
>Thanks.
>
>Martin
-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/

Reply via email to