|Perl Monk, Perl Meditation|
Re: Unicode problemby dakkar (Hermit)
|on Jun 19, 2005 at 09:55 UTC||Need Help??|
Works for me, Perl 5.8.2 on Linux. I wrote:
#!/usr/bin/perl use utf8; open my $fh,'<:encoding(sjis)','j.sjis.txt'; my $string='言葉'; print index(<$fh>,$string);
saving it as 'j.pl' as utf-8, and
saving it as 'j.sjis.txt' as shift-jis.
$ perl j.pl j.sjis.txt 4
(yes, I used <pre> instead of <code>... but <code> would not let me use character entities, and without the proper characters this answer would be useless)
-- dakkar - Mobilis in mobile
Most of my code is tested...