01_FHEMWEB.pm: fixing websocket crash on UTF-8 data (Forum #125866)

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@25631 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2022-02-05 10:10:43 +00:00
parent c876011358
commit 0a6ed64280

View File

@ -715,6 +715,7 @@ FW_addToWritebuffer($$@)
{
my ($hash, $txt, $callback, $nolimit) = @_;
utf8::encode($txt) if(utf8::is_utf8($txt) && $txt =~ m/[^\x00-\xFF]/ );
if( $hash->{websocket} ) {
my $len = length($txt);
if( $len < 126 ) {