[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1119] trunk/LedgerSMB



Revision: 1119
          http://svn.sourceforge.net/ledger-smb/?rev=1119&view=rev
Author:   tetragon
Date:     2007-04-28 14:01:17 -0700 (Sat, 28 Apr 2007)

Log Message:
-----------
Re-adding the base utf-8 fixes to trunk

Modified Paths:
--------------
    trunk/LedgerSMB/Form.pm
    trunk/LedgerSMB/Locale.pm
    trunk/LedgerSMB/Sysconfig.pm

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2007-04-27 23:59:40 UTC (rev 1118)
+++ trunk/LedgerSMB/Form.pm	2007-04-28 21:01:17 UTC (rev 1119)
@@ -41,6 +41,9 @@
 use Cwd;
 use File::Copy;
 
+use charnames ':full';
+use open ':utf8';
+
 package Form;
 
 sub new {
@@ -98,7 +101,7 @@
         $self->error( "Access Denied", __line__, __file__ );
     }
 
-    for ( keys %$self ) { $self->{$_} =~ s/\000//g }
+    for ( keys %$self ) { $self->{$_} =~ s/\N{NULL}//g }
     $self;
 }
 
@@ -138,6 +141,7 @@
         $str = $self->escape( $str, 1 ) if $1 == 0 && $2 < 44;
     }
 
+    $str = utf8::encode('utf8', $str);
     $str =~ s/([^a-zA-Z0-9_.-])/sprintf("%%%02x", ord($1))/ge;
     $str;
 
@@ -150,6 +154,7 @@
     $str =~ s/\\$//;
 
     $str =~ s/%([0-9a-fA-Z]{2})/pack("c",hex($1))/eg;
+    $str = utf8::decode('utf8', $str) unless utf8::is_utf8($str);
     $str =~ s/\r?\n/\n/g;
 
     $str;

Modified: trunk/LedgerSMB/Locale.pm
===================================================================
--- trunk/LedgerSMB/Locale.pm	2007-04-27 23:59:40 UTC (rev 1118)
+++ trunk/LedgerSMB/Locale.pm	2007-04-28 21:01:17 UTC (rev 1119)
@@ -27,7 +27,6 @@
 package LedgerSMB::Locale;
 use base 'Locale::Maketext';
 use Locale::Maketext::Lexicon;
-use HTML::Entities;
 use Encode;
 
 Locale::Maketext::Lexicon->import(
@@ -40,7 +39,7 @@
 
 sub text {
     my ( $self, $text, @params ) = @_;
-    return encode_entities( $self->maketext( $text, @params ) );
+    return $self->maketext( $text, @params );
 }
 
 ##sub date {

Modified: trunk/LedgerSMB/Sysconfig.pm
===================================================================
--- trunk/LedgerSMB/Sysconfig.pm	2007-04-27 23:59:40 UTC (rev 1118)
+++ trunk/LedgerSMB/Sysconfig.pm	2007-04-28 21:01:17 UTC (rev 1119)
@@ -8,6 +8,8 @@
 use Config::Std;
 use DBI qw(:sql_types);
 
+binmode STDOUT, ':utf8';
+
 # For Win32, change $pathsep to ';';
 $pathsep = ':';
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.