Yes I think that it might not be any standard transforming algorithm for
doing this, and the program that do that, do their own transform.
So finally I've decided to try finding all the possible chars with tildes,
acute or grave accents, umlauts, etc, and replace using tr//.
I hope I won't have any issues, because the chars are UTF-8.
Thanks.
Octavian
----- Original Message -----
From: "Gunnar Hjalmarsson" <[EMAIL PROTECTED]>
To: <beginners@perl.org>
Sent: Wednesday, December 26, 2007 7:33 PM
Subject: Re: replace chars
Tom Phoenix wrote:
On Dec 26, 2007 3:05 AM, Octavian Rasnita <[EMAIL PROTECTED]> wrote:
I want to replace some special characters with their corresponding
Western
European chars, for example a with a, â with a, s with s, t with t, î
with i
and so on.
I thought that all those characters were included in the Western European
character set ISO-8859-1, and if so, your requirement makes no sense. Do
you possibly mean corresponding ASCII characters?
Could you please recommend a module that can do this?
You might be able to do what you want with Encode.
http://perldoc.perl.org/Encode.html
Might he? How?
The Swedish alphabet contains three non-ascii characters: å, ä and ö. To
my knowledge, there is no official encoding scheme that converts them to
a, a and o respectively. That's natural, since 'å' is a completely
different character than 'a' etc.
Sometimes, the special Swedish characters are converted in an English
context, and based on how they are pronounced, like this:
å -> ou
ä -> ae
ö -> oe
I believe the OP will need to identify all the characters he would like to
see converted, and code the conversion rules himself using the tr/// or
s/// operator.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/