kraih/mojo — Issue #241: 'Mojo::JSON' does it work properly? 
Author: unera
Created: 2011-12-12 14:02:56+00:00
State: open

```
$ cat test.json.t
```

```perl
#!/usr/bin/perl

use warnings;
use strict;
use utf8;

use Test::More tests => 2;
use Encode qw(decode encode);

BEGIN {
my $builder = Test::More->builder;
binmode $builder->output, ":utf8";
binmode $builder->failure_output, ":utf8";
binmode $builder->todo_output, ":utf8";

use_ok 'Mojo::JSON';

}

my $json = '{"abc": "Привет медвед"}';

my $parsed = Mojo::JSON->new->decode($json);
diag explain $parsed unless ok $parsed, 'Parsed';
```

$ perl test.json.t

1..2
ok 1 - use Mojo::JSON;
not ok 2 - Parsed
# Failed test 'Parsed'
# at test.mojo.t line 26.
# undef
# Looks like you failed 1 test of 2.

If I replace russian character from input JSON it will work fine.