File: 32.synopsis.case3.t

package info (click to toggle)
libunicode-escape-perl 0.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 144 kB
  • ctags: 9
  • sloc: perl: 75; makefile: 11
file content (8 lines) | stat: -rwxr-xr-x 365 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
use Test::More tests => 1;

use Unicode::Escape;
my $str = "\x{82}\x{a0}\x{82}\x{a2}\x{82}\x{a4}\x{82}\x{a6}\x{82}\x{a8}";
my $escaper = Unicode::Escape->new($str, 'shiftjis'); # $str contains charactor that is not ASCII. $str is encoded by shiftjis.(default is utf8)
my $escaped = $escaper->escape;

is($escaped, '\\u3042\\u3044\\u3046\\u3048\\u304a', 'encoded');