[Rt-commit] r2096 - in rt/branches/PLATANO-EXPERIMENTAL: . lib/RT lib/t/regression

jesse at bestpractical.com jesse at bestpractical.com
Fri Jan 14 03:53:46 EST 2005


Author: jesse
Date: Fri Jan 14 03:53:46 2005
New Revision: 2096

Modified:
   rt/branches/PLATANO-EXPERIMENTAL/   (props changed)
   rt/branches/PLATANO-EXPERIMENTAL/lib/RT/Record.pm
   rt/branches/PLATANO-EXPERIMENTAL/lib/t/regression/03basic_web.t
Log:
 r2540 at hualien (orig r2041):  jesse | 2005-01-05T05:34:02.617895Z
  r2539 at hualien:  jesse | 2005-01-05T05:31:36.967112Z
  Better handling of Content that comes out of the database as utf8 (Such as with DBD::Oracle 1.16)
 


Modified: rt/branches/PLATANO-EXPERIMENTAL/lib/RT/Record.pm
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL/lib/RT/Record.pm	(original)
+++ rt/branches/PLATANO-EXPERIMENTAL/lib/RT/Record.pm	Fri Jan 14 03:53:46 2005
@@ -798,11 +798,9 @@
         return ( $self->loc( "Unknown ContentEncoding [_1]", $ContentEncoding ) );
     }
     if ( $ContentType eq 'text/plain' ) {
-        return Encode::decode_utf8($Content);
+       $Content = Encode::decode_utf8($Content) unless Encode::is_utf8($Content);
     }
-    else {
         return ($Content);
-    }
 }
 
 # {{{ LINKDIRMAP

Modified: rt/branches/PLATANO-EXPERIMENTAL/lib/t/regression/03basic_web.t
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL/lib/t/regression/03basic_web.t	(original)
+++ rt/branches/PLATANO-EXPERIMENTAL/lib/t/regression/03basic_web.t	Fri Jan 14 03:53:46 2005
@@ -48,10 +48,9 @@
 Encode::from_to($string, 'iso-8859-1', 'utf8');
 $agent->field('Subject' => "Foo");
 $agent->field('Content' => $string);
-ok($agent->submit(), "Created new ticket with $string");
+ok($agent->submit(), "Created new ticket with $string as Content");
 
 ok( $agent->{'content'} =~ qr{$string} , "Found the content");
-
 $agent->get($url."Ticket/Create.html?Queue=1");
 is ($agent->{'status'}, 200, "Loaded Create.html");
 $agent->form(3);
@@ -60,7 +59,7 @@
 Encode::from_to($string, 'iso-8859-1', 'utf8');
 $agent->field('Subject' => $string);
 $agent->field('Content' => "BAR");
-ok($agent->submit(), "Created new ticket with $string");
+ok($agent->submit(), "Created new ticket with $string as Subject");
 
 ok( $agent->{'content'} =~ qr{$string} , "Found the content");
 


More information about the Rt-commit mailing list