98_JsonList2.pm: Escape the Escpae (Forum #105446)

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@20561 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2019-11-22 19:59:14 +00:00
parent b437749488
commit f5bf3091cb

View File

@ -25,7 +25,7 @@ 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-\x1f\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";