File: _test_unicode.pl

package info (click to toggle)
libjcode-pm-perl 2.07-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,440 kB
  • sloc: perl: 14,814; ansic: 11,032; makefile: 3
file content (16 lines) | stat: -rw-r--r-- 452 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

use ExtUtils::testlib;
use Jcode::Unicode;
use Getopt::Std;
getopts("p");

my $file = "../t/table.euc";
my $euc, $ucs2, $utf8;
open F,  $file or die $!;
read F, $euc, -s $file;

print "1..2\n";
print "Ok 1\n" if $ucs2  = Jcode::Unicode::euc_ucs2($euc, $opt_p);
print "Ok 2\n" if $euc  eq Jcode::Unicode::ucs2_euc($ucs2, $opt_p);
print "Ok 3\n" if $utf8  = Jcode::Unicode::ucs2_utf8($ucs2);
print "Ok 4\n" if $ucs2 eq Jcode::Unicode::utf8_ucs2($utf8);