2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-07 12:58:13 +00:00

TcpServerUtils.pm: Watch out for wide characters (Forum #90145)

git-svn-id: https://svn.fhem.de/fhem/trunk@18528 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2019-02-08 11:30:37 +00:00
parent d9e1c373ff
commit c30d786a7c

View File

@ -293,7 +293,13 @@ TcpServer_WriteBlocking($$)
return undef;
}
my $ret = syswrite($sock, $txt, $len-$off, $off);
my $ret;
eval { $ret = syswrite($sock, $txt, $len-$off, $off); }; # Wide character
if($@) {
Log 1, $@;
Log 1, "txt:".join(":",unpack("C*",$txt)).",len:$len,off:$off";
stacktrace();
}
if( defined $ret ){
$off += $ret;