[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

foxr foxr at source.lon-capa.org
Mon May 28 08:23:04 EDT 2012


foxr		Mon May 28 12:23:04 2012 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  BZ 5945 - Need to explicitly define the return from ssi HTTP::Request to be
  utf8 via Encode::decode_utf8  ...many thanks to  gooogle:
  http://ahinea.com/en/tech/perl-unicode-struggle.html specifically.
  
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1172 loncom/lonnet/perl/lonnet.pm:1.1173
--- loncom/lonnet/perl/lonnet.pm:1.1172	Mon May 21 18:35:30 2012
+++ loncom/lonnet/perl/lonnet.pm	Mon May 28 12:23:03 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1172 2012/05/21 18:35:30 bisitz Exp $
+# $Id: lonnet.pm,v 1.1173 2012/05/28 12:23:03 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -75,6 +75,8 @@
 use HTTP::Date;
 use Image::Magick;
 
+use Encode;
+
 use vars qw(%perlvar %spareid %pr %prp $memcache %packagetab $tmpdir
             $_64bit %env %protocol %loncaparevs %serverhomeIDs %needsrelease
             %managerstab);
@@ -2568,12 +2570,12 @@
     }
 
     $request->header(Cookie => $ENV{'HTTP_COOKIE'});
-    my $response=$ua->request($request);
-
+    my $response= $ua->request($request);
+    my $content = Encode::decode_utf8($response->content);
     if (wantarray) {
-	return ($response->content, $response);
+	return ($content, $response);
     } else {
-	return $response->content;
+	return $content;
     }
 }
 




More information about the LON-CAPA-cvs mailing list