98_JsonList2.pm: fix for the fix

git-svn-id: https://svn.fhem.de/fhem/trunk@17230 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2018-08-30 13:03:48 +00:00
parent 7e5e647130
commit d3f881580a

View File

@ -26,8 +26,8 @@ JsonList2_Escape($)
my $a = shift; my $a = shift;
return "null" if(!defined($a)); return "null" if(!defined($a));
$a =~ s/([\x00-\x09\x0b-\x19\x5c])/sprintf '\u%04x', ord($1)/ge; # Forum 57377 $a =~ s/([\x00-\x09\x0b-\x19\x5c])/sprintf '\u%04x', ord($1)/ge; # Forum 57377
$a =~ s/"/\\\\"/g; $a =~ s/"/\\"/g;
$a =~ s/\n/\\\\n/g; $a =~ s/\n/\\n/g;
my $b = "x$a"; my $b = "x$a";
$a = "<BINARY>" if(!utf8::decode($b)); # Forum #55318 $a = "<BINARY>" if(!utf8::decode($b)); # Forum #55318
return $a; return $a;