- or download this
$ perl -MEncode=encode,from_to -wle'$s = encode("UTF-8", chr(0x2660));
+ from_to($s, "UTF-8", "ascii", Encode::FB_XMLCREF); print $s' | od -c
0000000 342 231 240 \n
0000004
- or download this
$ perl -MEncode=encode,from_to -wle'$s = encode("UTF-8", chr(0x2660));
+ from_to($s, "UTF-8", "ascii", Encode::FB_XMLCREF); print $s' | od -c
0000000 & # x 2 6 6 0 ; \n
0000011
- or download this
1..1
not ok 1 - With XML/HTML 4 digit hex entity
...
# got: '\u2660\u2660'
# expected: '♠\u2660'
# Looks like you failed 1 test of 1.
- or download this
#!/usr/bin/perl -T
...
}
is( escape_with_encode($_->[0]), $_->[1], $_->[2] ) for @tests;