specify use of the utf8 I/O layer
authorgmc <gmc@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 18 Mar 2011 02:44:54 +0000 (02:44 +0000)
committergmc <gmc@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 18 Mar 2011 02:44:54 +0000 (02:44 +0000)
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 <gmc@esilibrary.com>
git-svn-id: svn://svn.open-ils.org/OpenSRF/branches/rel_1_6@2211 9efc2488-bf62-4759-914b-345cdb29e865

src/perl/lib/OpenSRF/Transport/SlimJabber/Inbound.pm
src/perl/lib/OpenSRF/UnixServer.pm

index 898a528..5f44026 100644 (file)
@@ -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: $!");
index c4b48c8..1294a75 100644 (file)
@@ -67,6 +67,7 @@ sub process_request {
 
        my $self = shift;
        my $data; my $d;
+       binmode STDIN, ':utf8';
        while( $d = <STDIN> ) { $data .= $d; }
 
        my $orig = $0;