diff options
author | Guillermo Ramos | 2019-06-28 18:33:22 +0200 |
---|---|---|
committer | Guillermo Ramos | 2019-06-28 18:33:22 +0200 |
commit | 90093440e7c406cbd940c6841d92d6ffdae338bc (patch) | |
tree | 33a2340a2b27e4a87d1d320d4f9b6b3ce5b532fb /lib | |
parent | 105b36ca2c9783fb10f60994be0d93a4f1ad4767 (diff) | |
download | tgutils-90093440e7c406cbd940c6841d92d6ffdae338bc.tar.gz |
Fix UTF-8 handling in TgLib::Api
Diffstat (limited to 'lib')
-rw-r--r-- | lib/TgLib/Api.pm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/TgLib/Api.pm b/lib/TgLib/Api.pm index 3056073..e643a42 100644 --- a/lib/TgLib/Api.pm +++ b/lib/TgLib/Api.pm @@ -31,6 +31,8 @@ sub get_updates { die $resp->message; } else { my $updates = decode_json($resp->content)->{'result'}; + # TODO why does `decode_json` not do this work? + map { utf8::encode($_->{'message'}{'text'}) } @$updates; $logger->info(sprintf "Received %d updates from chats %s\n", scalar(@$updates), join(", ", map { $_->{'message'}{'chat'}{'id'} } @$updates)); |