From: Stevan Little Date: Tue, 16 Oct 2007 04:12:56 +0000 (+0000) Subject: foo X-Git-Tag: 0_09~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6f491fae2191d6ee59603e043ee94b6ad459262d;p=gitmo%2FMooseX-Storage.git foo --- diff --git a/Changes b/Changes index 5f833dc..20fe33a 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,10 @@ Revision history for MooseX-Storage -0.08 +0.09 + * MooseX::Storage::Util + - added support to deal with utf8 strings correctly + +0.08 Wed. Oct. 10, 2007 * MooseX::Storage::Format::JSON - added support to deal with utf8 strings correctly diff --git a/lib/MooseX/Storage/Util.pm b/lib/MooseX/Storage/Util.pm index e0ddcb7..761557b 100644 --- a/lib/MooseX/Storage/Util.pm +++ b/lib/MooseX/Storage/Util.pm @@ -2,8 +2,9 @@ package MooseX::Storage::Util; use Moose qw(confess blessed); use MooseX::Storage::Engine (); +use utf8 (); -our $VERSION = '0.02'; +our $VERSION = '0.03'; our $AUTHORITY = 'cpan:STEVAN'; sub peek { @@ -35,6 +36,8 @@ sub _inflate_json { eval { JSON::Any->import }; confess "Could not load JSON module because : $@" if $@; + utf8::encode($json) if utf8::is_utf8($json); + my $data = eval { JSON::Any->jsonToObj($json) }; if ($@) { confess "There was an error when attempting to peek at JSON: $@"; @@ -49,7 +52,6 @@ sub _inflate_yaml { require Best; eval { Best->import([[ qw[YAML::Syck YAML] ]]) }; confess "Could not load YAML module because : $@" if $@; - my $inflater = Best->which('YAML::Syck')->can('Load');