From 82a94a9ce2e7e761fea788267665fc51a0813765 Mon Sep 17 00:00:00 2001 From: miker Date: Sat, 19 Nov 2005 04:20:15 +0000 Subject: [PATCH] touchup on the unicode handler git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@579 9efc2488-bf62-4759-914b-345cdb29e865 --- src/perlmods/JSON.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/perlmods/JSON.pm b/src/perlmods/JSON.pm index 6c48a14..e36638f 100644 --- a/src/perlmods/JSON.pm +++ b/src/perlmods/JSON.pm @@ -206,7 +206,7 @@ sub perl2JSON { $outkey =~ s/\f/\\f/sgo; $outkey =~ s/\r/\\r/sgo; $outkey =~ s/\n/\\n/sgo; - $outkey =~ s/(\PM\pM)/sprintf('\u%0.4x',ord(NFC($1)))/sgoe; + $outkey =~ s/(\PM\pM+)/sprintf('\u%0.4x',ord(NFC($1)))/sgoe; $output .= '"'.$outkey.'":'. perl2JSON(undef,$$perl{$key}, $strict); $c++; @@ -315,7 +315,7 @@ sub perl2prettyJSON { $perl =~ s/\f/\\f/sgo; $perl =~ s/\r/\\r/sgo; $perl =~ s/\n/\\n/sgo; - $perl =~ s/(\PM\pM)/sprintf('\u%0.4x',ord(NFC($1)))/sgoe; + $perl =~ s/(\PM\pM+)/sprintf('\u%0.4x',ord(NFC($1)))/sgoe; $output .= " "x$depth unless($nospace); if (length($perl) < 10 and $perl =~ /^(?:\+|-)?\d*\.?\d+$/o and $perl !~ /^(?:\+|-)?0\d+/o ) { $output = $perl; -- 2.11.0