YAML Framework Matrix

Test #H3Z8 - Literal unicode

YAML

---
wanted: love ♥ and peace ☮

Expected Events

+STR
+DOC ---
+MAP
=VAL :wanted
=VAL :love ♥ and peace ☮
-MAP
-DOC
-STR

Expected JSON

{
"wanted" : "love \u00e2\u0099\u00a5 and peace \u00e2\u0098\u00ae"
}

cpp-event

 ok

java-event

 ok

java-json

 json_ok

js-yaml-json

 json_ok

libyaml-event

 ok

luajit-json

 json_ok

nimyaml-event

 ok

perl5-pegex-event

 ok

perl5-pm-json

 json_diff
{
   "wanted" : "love \u00c3\u00a2\u00c2\u0099\u00c2\u00a5 and peace \u00c3\u00a2\u00c2\u0098\u00c2\u00ae"
}

perl5-pm-pl

 n/a
{
  'wanted' => 'love ♥ and peace ☮'
}

perl5-pp-event

 error
+STR
Line      : 2
Message   : Invalid plain scalar
Where     : /lib/perl5/YAML/PP/Lexer.pm line 660
YAML      : "wanted: love \342"
  at /bin/perl5-pp-event line 18.

perl5-pp-json

 error
Line      : 2
Message   : Invalid plain scalar
Where     : /lib/perl5/YAML/PP/Lexer.pm line 660
YAML      : "wanted: love \342"
  at /lib/perl5/YAML/PP/Loader.pm line 52.

perl5-pp-pl

 error
Line      : 2
Message   : Invalid plain scalar
Where     : /lib/perl5/YAML/PP/Lexer.pm line 660
YAML      : "wanted: love \342"
  at /lib/perl5/YAML/PP/Loader.pm line 52.

perl5-syck-json

 json_diff
{
   "wanted" : "love \u00c3\u00a2\u00c2\u0099\u00c2\u00a5 and peace \u00c3\u00a2\u00c2\u0098\u00c2\u00ae"
}

perl5-syck-pl

 n/a
{
  'wanted' => 'love ♥ and peace ☮'
}

perl5-tiny-json

 json_diff
{
   "wanted" : "love \u00c3\u00a2\u00c2\u0099\u00c2\u00a5 and peace \u00c3\u00a2\u00c2\u0098\u00c2\u00ae"
}

perl5-tiny-pl

 n/a
{
  'wanted' => "love \x{e2}\x{99}\x{a5} and peace \x{e2}\x{98}\x{ae}"
}

perl5-xs-json

 json_ok

perl5-xs-pl

 n/a
{
  'wanted' => "love \x{2665} and peace \x{262e}"
}

pyyaml-event

 error
+STR
+DOC
+MAP
=VAL :wanted
=VAL
Traceback (most recent call last):
  File "/bin/pyyaml-event", line 47, in <module>
    sys.stdout.write(' :' + value)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2665' in position 7: ordinal not in range(128)

ruamel-event

 error
+STR
+DOC
+MAP
=VAL :wanted
=VAL
Traceback (most recent call last):
  File "/bin/ruamel-event", line 46, in <module>
    sys.stdout.write(' :' + value)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2665' in position 7: ordinal not in range(128)

ruby-json

 json_ok