From 556e11074ad0bbc3cf3d6f978b13c483e6486a14 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Tue, 4 Jul 2017 18:54:45 +0200 Subject: [PATCH] fix Umlaute bei screenMsg --- 82_LGTV_WebOS.pm | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/82_LGTV_WebOS.pm b/82_LGTV_WebOS.pm index 152c83b..e7f2918 100644 --- a/82_LGTV_WebOS.pm +++ b/82_LGTV_WebOS.pm @@ -31,8 +31,19 @@ ################################# ######### Wichtige Hinweise und Links ################# - - +# +## Das JSON Modul immer in einem eval aufrufen +# $data = eval{decode_json($data)}; +# +# if($@){ +# Log3($SELF, 2, "$TYPE ($SELF) - error while request: $@"); +# +# readingsSingleUpdate($hash, "state", "error", 1); +# +# return; +# } +## +## ## # @@ -49,14 +60,14 @@ use MIME::Base64; use IO::Socket::INET; use Digest::SHA qw(sha1_hex); use JSON qw(decode_json encode_json); -use Encode qw(encode_utf8); +use Encode qw(encode_utf8 decode_utf8); use Blocking; -my $version = "0.6.0"; +my $version = "0.8.0"; @@ -412,7 +423,7 @@ sub LGTV_WebOS_Set($@) { return "usage: screenMsg " if( @args < 1 ); my $msg = join(" ", @args); - $payload{$lgCommands{$cmd}->[1]} = $msg; + $payload{$lgCommands{$cmd}->[1]} = decode_utf8($msg); $uri = $lgCommands{$cmd}->[0]; } elsif($cmd eq 'on' or $cmd eq 'off') {