Skip to content

Commit

Permalink
Support new Encode.pm
Browse files Browse the repository at this point in the history
  • Loading branch information
moznion committed Mar 17, 2014
1 parent ae61d13 commit 9ee8367
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions cpanfile
Expand Up @@ -41,6 +41,7 @@ requires 'Starlet';
requires 'HTML::FromANSI::Tiny', '0.103';
requires 'FindBin::libs';
requires 'Compress::Zlib';
requires 'Encode', '2.57';

on 'develop' => sub {
requires 'Locale::Maketext::Extract::Plugin::Xslate', 'v0.0.2';
Expand Down
7 changes: 6 additions & 1 deletion lib/Ukigumo/Server/Command/Report.pm
Expand Up @@ -257,7 +257,12 @@ sub _compress_text_data {
sub _uncompress_text_data {
my ($self, $row) = @_;
c->config->{enable_compression} or return $row;
$row->{$_} = decode_utf8(__uncompress($row->{$_})) for qw(vc_log body);

for my $type (qw/vc_log body/) {
# For new Encode.pm
eval { $row->{$type} = decode_utf8(__uncompress($row->{$type})) };
}

$row;
}

Expand Down

0 comments on commit 9ee8367

Please sign in to comment.