On Nov 26, 9:43 am, [EMAIL PROTECTED] (Ivan Bogdanov) wrote:
> Hi,
>
> I have some problems with transliteration from Cyrillic text into
> Latin.
> I my mind, i have two ways to solve the problem:
> 1) using a tr/// operator, but it not the best way i think, because in
> Russian it might be one symbol and in transit it would be two
> symbols.
> 2) using two arrays, something like this:
>    my @cstring=qw(Á Â × Ç Ä Å £ Ö Ú É Ê Ë Ì Í Î Ï Ð Ò Ó Ô Õ Æ È Ã Þ Û
> Ý ß Ù Ø Ü À Ñ);
>    my @lstring=qw(a b v g d e yo g z i y k l m n o p r s t u f x c ch
> sh shch ' yi ' e yu ya);
>
> and then substitute each symbol. And here i have  a problem.
> Ohhh, i have a string like this - $string = "ðÏÐÏ× ð ð", and i need to
> convert it to $string = "Popov_PP". Can anybody help me with this?

Well, the characters in $string are not in @cstring so I'm not quite
sure how you expect that to work.

But if you just want to replace characters in @cstring with the
corresponding string in @lstring then you could do something like...

my %c2l;
@[EMAIL PROTECTED]@lstring;
$string =~ s/(.)/$c2l{$1}||$1/eg;


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to