Re: replace chars
- From: orasnita@xxxxxxxxx (Octavian Rasnita)
- Date: Wed, 26 Dec 2007 19:49:20 +0200
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" <noreply@xxxxxxxxx>
To: <beginners@xxxxxxxx>
Sent: Wednesday, December 26, 2007 7:33 PM
Subject: Re: replace chars
Tom Phoenix wrote:On Dec 26, 2007 3:05 AM, Octavian Rasnita <orasnita@xxxxxxxxx> 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: beginners-unsubscribe@xxxxxxxx
For additional commands, e-mail: beginners-help@xxxxxxxx
http://learn.perl.org/
.
- Follow-Ups:
- Re: replace chars
- From: Gunnar Hjalmarsson
- Re: replace chars
- References:
- replace chars
- From: Octavian Rasnita
- Re: replace chars
- From: Tom Phoenix
- Re: replace chars
- From: Gunnar Hjalmarsson
- replace chars
- Prev by Date: Re: replace chars
- Next by Date: Re: replace chars
- Previous by thread: Re: replace chars
- Next by thread: Re: replace chars
- Index(es):
Relevant Pages
|
|