[Za-pm] ascii high order character conversion

Anne Wainwright aesop at fables.co.za
Thu May 8 09:20:11 PDT 2008


Hi.

I have data prepared on a dos programme that involves high order 
characters, like european letters with umlauts, cedillas, acute and grave 
accents etc.

I have a dos utility that I wrote that converts all of these to plain 
unaccented characters, a simple replacement operation. The reason being 
that in moving the data to Windows it does not show them correctly and this 
was the easiest way to go at the time. Now I am away from that route and 
want to build this into my perl database conversion routine (convert from 
proprietary to delimited).

Now I am wondering if there is an easier way in perl than doing a s/// for 
each of the characters used. I looked in the Perl Cookbook, and had a 
wander through the CPAN modules, but nothing struck me as specific for the 
task in hand.

Not that lines of s/// wouldn't do the job, but I wondered if there was a 
more concise way of programming this to convert either to the plain 
unaccented character or to the correct windows character.

[maybe I must study the "perlebcdic Considerations for running Perl on 
EBCDIC platforms" found on CPAN which looks like it might be a guide. 
suggests tr///   , will absorb this evening]

Had hoped for a ready module from CPAN, but see nothing.

Any ideas gratefully received on what must have been a common problem some 
years back?


Regards
Anne
----
Anne Wainwright



More information about the Za-pm mailing list