From 521194598546eaf5c7fba51cad218929677bd515 Mon Sep 17 00:00:00 2001 From: Otto123 <> Date: Tue, 2 Jan 2024 13:14:15 +0000 Subject: [PATCH] 99_valetudoUtils.pm:Forum topic=121017.msg1297370 git-svn-id: https://svn.fhem.de/fhem/trunk@28332 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/AttrTemplate/99_valetudoUtils.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fhem/contrib/AttrTemplate/99_valetudoUtils.pm b/fhem/contrib/AttrTemplate/99_valetudoUtils.pm index c223657de..f972f915a 100644 --- a/fhem/contrib/AttrTemplate/99_valetudoUtils.pm +++ b/fhem/contrib/AttrTemplate/99_valetudoUtils.pm @@ -26,7 +26,8 @@ sub decode_j { use JSON qw(decode_json); my $maybe_json = shift; my $data; - if ( eval { $data = decode_json($maybe_json); 1 } ) { return $data } + # from message https://forum.fhem.de/index.php?msg=1297370 + if ( eval { $data = JSON->new->utf8->decode(encode('UTF-8', $maybe_json)); 1 } ) { return $data } Log3(undef, 1, "JSON decoding error, >$maybe_json< seems not to be valid JSON data: $@"); return q{} }