Re: replace chars
- From: noreply@xxxxxxxxx (Gunnar Hjalmarsson)
- Date: Wed, 26 Dec 2007 18:33:18 +0100
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
.
- Follow-Ups:
- Re: replace chars
- From: Tom Phoenix
- Re: replace chars
- From: Octavian Rasnita
- Re: replace chars
- References:
- replace chars
- From: Octavian Rasnita
- Re: replace chars
- From: Tom Phoenix
- 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
|