From: miker Date: Tue, 6 Sep 2005 15:21:12 +0000 (+0000) Subject: normalizing wide chars X-Git-Tag: osrf_rel_2_0_1~1348 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=906310671e0e981db96e7c60199d870a87222426;p=OpenSRF.git normalizing wide chars git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@525 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perlmods/JSON.pm b/src/perlmods/JSON.pm index f3c798c..71dd28a 100644 --- a/src/perlmods/JSON.pm +++ b/src/perlmods/JSON.pm @@ -1,3 +1,4 @@ + package JSON::number; sub new { my $class = shift; @@ -26,6 +27,7 @@ use overload ( '0+' => sub { 0 } ); sub toString { 'false' } package JSON; +use Unicode::Normalize; use vars qw/%_class_map/; sub register_class_hint { @@ -225,6 +227,7 @@ sub perl2JSON { JSON->register_class_hint(name => $name, hint => $name, type => lc($type)); $output .= perl2JSON(undef,$perl, $strict); } else { + $perl = NFD($perl); $perl =~ s{\\}{\\\\}sgo; $perl =~ s/"/\\"/sgo; $perl =~ s/\t/\\t/sgo; @@ -304,6 +307,7 @@ sub perl2prettyJSON { register_class_hint(undef, name => $name, hint => $name, type => lc($type)); $output .= perl2prettyJSON(undef,$perl); } else { + $perl = NFD($perl); $perl =~ s/\\/\\\\/sgo; $perl =~ s/"/\\"/sgo; $perl =~ s/\t/\\t/sgo;