[otrs-cvs] otrs/Kernel/System YAML.pm,1.1,1.2
"CVS commits notifications of OTRS.org" <[email protected]>
| Newsgroups | gmane.comp.otrs.cvs |
|---|---|
| Message-ID | <[email protected]> |
Comments:
Update of /home/cvs/otrs/Kernel/System
In directory lancelot:/tmp/cvs-serv17880/Kernel/System
Modified Files:
YAML.pm
Log Message:
Improved unicode handling, added tests.
Author: mg
Index: YAML.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/YAML.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -2 -u -d -r1.1 -r1.2
--- YAML.pm 15 Jan 2013 17:43:26 -0000 1.1
+++ YAML.pm 16 Jan 2013 07:41:26 -0000 1.2
@@ -16,4 +16,5 @@
use YAML::Any qw();
+use Encode qw();
use vars qw($VERSION);
@@ -35,7 +36,6 @@
my $Result = YAML::Any::Dump(@_);
- # Make sure the resulting string has the UTF-8 flag. YAML only sets it if
- # part of the data already had it.
- utf8::upgrade($Result);
+ # Make sure the resulting string has the UTF-8 flag.
+ Encode::_utf8_on($Result);
return $Result;
@@ -44,4 +44,7 @@
sub Load {
my $Result = eval {
+ if ( Encode::is_utf8( $_[0] ) ) {
+ Encode::_utf8_off( $_[0] );
+ }
YAML::Any::Load(@_);
};
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log