1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#!/usr/bin/perl
use Benchmark;
use Jcode;
$count = 50000;
$icode = 'sjis';
# $icode = 'euc';
# $icode = 'jis';
# $icode = 'utf8';
$japanese = 'あいうえお阿衣兎得緒';
&Jcode::convert($japanese, $icode);
print "Content-type: text/htmlnn";
print "<html><head><title></title></head>n";
print "<body>n";
print "<pre>n";
@t = timethese($count, {
'to_SJIS' => '&to_sjis;'
,'to_EUC' => '&to_euc;'
,'to_JIS' => '&to_jis;'
# ,'to_UTF8' => '&to_utf8;'
});
print "</pre>n";
print "</body></html>n";
exit(0);
sub to_sjis{
&Jcode::convert($japanese, 'sjis', $icode);
}
sub to_euc{
&Jcode::convert($japanese, 'euc', $icode);
}
sub to_jis{
&Jcode::convert($japanese, 'jis', $icode);
}
sub to_utf8{
&Jcode::convert($japanese, 'utf8', $icode);
}
|