X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FStorage%2FFormat%2FJSON.pm;h=1afda1b527e31731edde03c357ba328ab977643f;hb=6f80d4038446bbbc3c1abfc467a5fe2b81c1c404;hp=67324d62ff09a764e948e5c1a0f835ddc1077e63;hpb=a99b06bc698f521b77656a1015fb4c572e39dfeb;p=gitmo%2FMooseX-Storage.git diff --git a/lib/MooseX/Storage/Format/JSON.pm b/lib/MooseX/Storage/Format/JSON.pm index 67324d6..1afda1b 100644 --- a/lib/MooseX/Storage/Format/JSON.pm +++ b/lib/MooseX/Storage/Format/JSON.pm @@ -7,7 +7,7 @@ no warnings 'once'; use JSON::Any; use utf8 (); -our $VERSION = '0.27'; +our $VERSION = '0.32'; our $AUTHORITY = 'cpan:STEVAN'; requires 'pack'; @@ -16,12 +16,12 @@ requires 'unpack'; sub thaw { my ( $class, $json, @args ) = @_; utf8::encode($json) if utf8::is_utf8($json); - $class->unpack( JSON::Any->jsonToObj($json), @args ); + $class->unpack( JSON::Any->new->jsonToObj($json), @args ); } sub freeze { my ( $self, @args ) = @_; - my $json = JSON::Any->objToJson( $self->pack(@args) ); + my $json = JSON::Any->new(canonical => 1)->objToJson( $self->pack(@args) ); utf8::decode($json) if !utf8::is_utf8($json) and utf8::valid($json); # if it's valid utf8 mark it as such return $json; }