Browse Source

* LDV::Zerobin->_content_*() : utf8

master
Alex 'AdUser' Z 9 years ago
parent
commit
5fdd7e00fe
  1. 5
      lib/LDV/Zerobin.pm

5
lib/LDV/Zerobin.pm

@ -49,6 +49,7 @@ sub _content_save {
unless (ref $content) {
my $asset = Mojo::Asset::File->new;
utf8::encode($content);
$asset->add_chunk($content);
$content = $asset; # wrap plaintext to Mojo::Asset
}
@ -65,8 +66,10 @@ sub _content_load {
die("paste content not found\n") unless (-f $path);
my $asset = Mojo::Asset::File->new(path => $path);
$asset->cleanup(0);
my $content = $asset->slurp;
utf8::decode($content);
return $asset->slurp;
return $content;
}
sub create {

Loading…
Cancel
Save