From: miker Date: Tue, 6 Sep 2005 15:38:35 +0000 (+0000) Subject: matching non-letter and non-number X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b4b86e95b178a3644d7e12eda83f8ed44126bd98;p=opensrf%2Fbjwebb.git matching non-letter and non-number git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@529 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perlmods/JSON.pm b/src/perlmods/JSON.pm index 995f161..4c0530b 100644 --- a/src/perlmods/JSON.pm +++ b/src/perlmods/JSON.pm @@ -234,7 +234,7 @@ sub perl2JSON { $perl =~ s/\f/\\f/sgo; $perl =~ s/\r/\\r/sgo; $perl =~ s/\n/\\n/sgo; - $perl =~ s/(\P{L}|\P{N})/sprintf('\u%0.4x',ord($1))/sgoe; + $perl =~ s/(\pM|\pS|\pC)/sprintf('\u%0.4x',ord($1))/sgoe; if (length($perl) < 10 and $perl =~ /^(?:\+|-)?\d*\.?\d+$/o and $perl !~ /^(?:\+|-)?0\d+/o ) { $output = $perl; } else { @@ -314,7 +314,7 @@ sub perl2prettyJSON { $perl =~ s/\f/\\f/sgo; $perl =~ s/\r/\\r/sgo; $perl =~ s/\n/\\n/sgo; - $perl =~ s/(\P{L}|\P{N}|\P{P})/sprintf('\u%0.4x',ord($1))/sgoe; + $perl =~ s/(\pM|\pS|\pC)/sprintf('\u%0.4x',ord($1))/sgoe; $output .= " "x$depth unless($nospace); if (length($perl) < 10 and $perl =~ /^(?:\+|-)?\d*\.?\d+$/o and $perl !~ /^(?:\+|-)?0\d+/o ) { $output = $perl;