From 5fdd7e00fe7daab69137547a026bd09be45c8443 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Sun, 10 Apr 2016 13:05:04 +1000 Subject: [PATCH] * LDV::Zerobin->_content_*() : utf8 --- lib/LDV/Zerobin.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/LDV/Zerobin.pm b/lib/LDV/Zerobin.pm index c2bcd4b..f4b3dfd 100644 --- a/lib/LDV/Zerobin.pm +++ b/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 {