summaryrefslogtreecommitdiff
path: root/lib/Multi/API.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-04-29 10:11:46 +0200
committerYorhel <git@yorhel.nl>2015-04-29 10:11:46 +0200
commitfdda38d11baba8a24d97d4c19b75eee158666bfa (patch)
tree92362205b043a5fbc01c5892be8b28d2062a85bf /lib/Multi/API.pm
parentfcd4056671eab67b8a18416e743bb3abe092a626 (diff)
Multi::(API:IRC): Fix some unicode handling issues
I forgot that AnyEvent::Handle works with bytes rather than unicode strings, even though that is kind of obvious. I expected that AnyEvent::IRC would automatically handle the conversion between byte strings and Unicode strings, but it doesn't, so that has to be done manually.
Diffstat (limited to 'lib/Multi/API.pm')
-rw-r--r--lib/Multi/API.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Multi/API.pm b/lib/Multi/API.pm
index a5a4b3f5..36b4be5c 100644
--- a/lib/Multi/API.pm
+++ b/lib/Multi/API.pm
@@ -12,7 +12,7 @@ use AnyEvent::Socket;
use AnyEvent::Handle;
use POE::Filter::VNDBAPI 'encode_filters';
use Digest::SHA 'sha256';
-use Encode 'encode_utf8';
+use Encode 'encode_utf8', 'decode_utf8';
use Crypt::ScryptKDF 'scrypt_raw';;
use VNDBUtil 'normalize_query', 'norm_ip';
use JSON::XS;
@@ -153,7 +153,7 @@ sub cmd_read {
(my $msg = $_[1]) =~ s/[\r\n]*/ /;
$msg =~ s/^[\s\r\n\t]+//;
$msg =~ s/[\s\r\n\t]+$//;
- writelog $c, "< $msg" if $cmd && $cmd ne 'login';
+ writelog $c, decode_utf8 "< $msg" if $cmd && $cmd ne 'login';
# Stats for the current cmd
$c->{sqlt} = $c->{sqlq} = 0;