[Rt-commit] r2041 - in rt/branches/3.4-RELEASE: . lib/RT lib/t/regression

jesse at bestpractical.com jesse at bestpractical.com
Wed Jan 5 00:34:03 EST 2005


Author: jesse
Date: Wed Jan  5 00:34:02 2005
New Revision: 2041

Modified:
   rt/branches/3.4-RELEASE/   (props changed)
   rt/branches/3.4-RELEASE/lib/RT/Record.pm
   rt/branches/3.4-RELEASE/lib/t/regression/03basic_web.t
Log:
 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/3.4-RELEASE/lib/RT/Record.pm
==============================================================================
--- rt/branches/3.4-RELEASE/lib/RT/Record.pm	(original)
+++ rt/branches/3.4-RELEASE/lib/RT/Record.pm	Wed Jan  5 00:34:02 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/3.4-RELEASE/lib/t/regression/03basic_web.t
==============================================================================
--- rt/branches/3.4-RELEASE/lib/t/regression/03basic_web.t	(original)
+++ rt/branches/3.4-RELEASE/lib/t/regression/03basic_web.t	Wed Jan  5 00:34:02 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