B
Bart van den Burg
Hi
I'm starting to get some interest in east european languages (by now i know
a few words Latvian), and I'm trying to convert russian texts to fonetical
english. However, I think Perl is tripping over the charsets here, cause all
output i get from running the script below is
Use of uninitialized value in print at russisch.pl line 20.
25 times
Now i'm wondering: am i missing something extremely stupid here, or is this
really a problem? And if the latter is true: What can I do about it?
I save the text as UTF-8 in windows over samba to a linux computer... when I
do "cat russisch.pl" on an SSH shell with charset set to UTF-8, all is
correct
Thx
Bart
------------------------------------
#!/usr/bin/perl -w
use strict;
my $line = "????????????!";
my %write = (
"?" => "a",
"?" => "d",
"?" => "Z",
"?" => "r",
"?" => "v",
"?" => "s",
"?" => "t",
"?" => "oo",
"?" => "i",
"e" => "ye",
);
foreach (split(//, $line)) {
print $write{$_};
}
print "\n";
I'm starting to get some interest in east european languages (by now i know
a few words Latvian), and I'm trying to convert russian texts to fonetical
english. However, I think Perl is tripping over the charsets here, cause all
output i get from running the script below is
Use of uninitialized value in print at russisch.pl line 20.
25 times
Now i'm wondering: am i missing something extremely stupid here, or is this
really a problem? And if the latter is true: What can I do about it?
I save the text as UTF-8 in windows over samba to a linux computer... when I
do "cat russisch.pl" on an SSH shell with charset set to UTF-8, all is
correct
Thx
Bart
------------------------------------
#!/usr/bin/perl -w
use strict;
my $line = "????????????!";
my %write = (
"?" => "a",
"?" => "d",
"?" => "Z",
"?" => "r",
"?" => "v",
"?" => "s",
"?" => "t",
"?" => "oo",
"?" => "i",
"e" => "ye",
);
foreach (split(//, $line)) {
print $write{$_};
}
print "\n";