test_locale.pl
1 | #! /usr/bin/perl |
---|---|
2 | |
3 | use utf8; |
4 | use Locale::gettext; |
5 | |
6 | binmode(STDOUT, ":utf8"); |
7 | |
8 | $d="auto-multiple-choice"; |
9 | $s="Copying scans to project directory..."; |
10 | |
11 | print "* utf8\n"; |
12 | print "Des œufs cassés\n"; |
13 | |
14 | print "* simple\n"; |
15 | my $l=Locale::gettext->domain($d); |
16 | print $l->get($s)."\n"; |
17 | |
18 | print "* raw\n"; |
19 | my $lr=Locale::gettext->domain_raw($d); |
20 | $lr->codeset("UTF-8"); |
21 | print $lr->get($s)."\n"; |
22 | |
23 | print "* decode\n"; |
24 | my $lh=Locale::gettext->domain_raw($d); |
25 | my $ss=$lh->get($s); |
26 | utf8::decode($ss); |
27 | print($ss."\n"); |
28 |