t/zero-mojibake.t
raw| 1 | use strict; |
| 2 | use warnings; |
| 3 | use Test::More; |
| 4 | BEGIN { plan tests => 1 }; |
| 5 | |
| 6 | BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } |
| 7 | |
| 8 | use JSON; |
| 9 | |
| 10 | my $json = JSON->new; |
| 11 | |
| 12 | my $input = q[ |
| 13 | { |
| 14 | "dynamic_config" : 0, |
| 15 | "x_contributors" : [ |
| 16 | "大沢 åå®", |
| 17 | "Ãvar Arnfjörð" |
| 18 | ] |
| 19 | } |
| 20 | ]; |
| 21 | eval { $json->decode($input) }; |
| 22 | is $@, '', 'decodes 0 with mojibake without error'; |