From: gmc Date: Fri, 18 Mar 2011 02:44:54 +0000 (+0000) Subject: specify use of the utf8 I/O layer X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fdbd0c398a7c04f72926cfac843b2acf1449439e;p=OpenSRF.git specify use of the utf8 I/O layer Solves problem where invoking a method via osrf_http_translator resulted in an exception thrown by FreezeThaw if any of the characters in the message are non-ASCII *and* not in the Latin-1 character set. Oddly, if Evergreen been originally developed in Georgia the country, not Georgia the state, the bug would have been apparent much earlier. Signed-off-by: Galen Charlton git-svn-id: svn://svn.open-ils.org/OpenSRF/branches/rel_1_6@2211 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perl/lib/OpenSRF/Transport/SlimJabber/Inbound.pm b/src/perl/lib/OpenSRF/Transport/SlimJabber/Inbound.pm index 898a528..5f44026 100644 --- a/src/perl/lib/OpenSRF/Transport/SlimJabber/Inbound.pm +++ b/src/perl/lib/OpenSRF/Transport/SlimJabber/Inbound.pm @@ -157,6 +157,7 @@ sub listen { # keep trying to deliver the message until we succeed my $socket = IO::Socket::UNIX->new( Peer => $sock ); + binmode $socket, ':utf8'; unless($socket and $socket->connected) { $logger->error("$app inbound: unable to connect to inbound socket $sock: $!"); diff --git a/src/perl/lib/OpenSRF/UnixServer.pm b/src/perl/lib/OpenSRF/UnixServer.pm index c4b48c8..1294a75 100644 --- a/src/perl/lib/OpenSRF/UnixServer.pm +++ b/src/perl/lib/OpenSRF/UnixServer.pm @@ -67,6 +67,7 @@ sub process_request { my $self = shift; my $data; my $d; + binmode STDIN, ':utf8'; while( $d = ) { $data .= $d; } my $orig = $0;