2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

JsonList2.pm: Do not emit non-utf-8 data (Forum #55318)

git-svn-id: https://svn.fhem.de/fhem/trunk@11764 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2016-07-08 09:27:57 +00:00
parent ce05d7c027
commit 095a9b53ee

View File

@ -36,6 +36,8 @@ JsonList2_Escape($)
"\'" => '\\\'',
);
$a =~ s/([\x22\x5c\n\r\t\f\b])/$esc{$1}/eg;
my $b = "x$a";
$a = "<BINARY>" if(!utf8::decode($b)); # Forum #55318
return $a;
}