mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
98_JsonMod.pm: fix: encoder not defined #634
git-svn-id: https://svn.fhem.de/fhem/trunk@21544 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
736d0d554c
commit
9dcdd8afc1
@ -631,7 +631,8 @@ sub JsonMod_ApiResponse {
|
||||
# bool = utf8::is_utf8(string)
|
||||
# if true: utf8::encode(string);
|
||||
|
||||
my $enc = Encode::find_encoding($encoding)->name();
|
||||
my $enc = Encode::find_encoding($encoding);
|
||||
$enc = (defined($enc))?$enc->name():'utf-8-strict'; # precaution required in case of invalid respone
|
||||
Encode::from_to($data, $encoding, 'UTF-8') unless ($enc eq 'utf-8-strict');
|
||||
JsonMod_Logger($hash, 4, 'api encoding is %s, designated encoder is %s', $encoding, $enc);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user