diff options
Diffstat (limited to 't/zero-mojibake.t')
-rw-r--r-- | t/zero-mojibake.t | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/t/zero-mojibake.t b/t/zero-mojibake.t new file mode 100644 index 0000000..72c48f8 --- /dev/null +++ b/t/zero-mojibake.t @@ -0,0 +1,21 @@ +use strict; +use Test::More; +BEGIN { plan tests => 1 }; + +BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } + +use JSON; + +my $json = JSON->new; + +my $input = q[ +{ + "dynamic_config" : 0, + "x_contributors" : [ + "大沢 åå®", + "Ãvar Arnfjörð" + ] +} +]; +eval { $json->decode($input) }; +is $@, '', 'decodes 0 with mojibake without error'; |