aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/TgLib/Api.pm2
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));