• Welcome to OS2World OLD-STATIC-BACKUP Forum.
 

News:

This is an old OS2World backup forum for reference only. IT IS READ ONLY!!!

If you need help with OS/2 - eComStation visit http://www.os2world.com/forum

Main Menu

Detecting french accents

Started by Fahrvenugen, 2011.08.17, 23:53:47

Previous topic - Next topic

Fahrvenugen

I've got a REXX script where a portion of it I use the TRANSLATE function to strip out unwanted characters from a string and replace them with nothing.  The code looks like:

sentence = TRANSLATE(sentence,"","/-?&`!().,")

Essentially the output of this script gets pushed to another utility that has difficulties with some of these characters, so I strip them out first.

Recently I've run into a situation where the sentence variable can end up with a french accent character.  I'd like to be able to add these characters into the translate command so they also get stripped out.

Does anyone know how to add this type of character so REXX will recognize it?

Thanks

ivan

Wouldn't that need some sort of search and replace function otherwise you will end up with some strange words if you just take out accented letters and leave blanks.

ivan

Fahrvenugen

That's a good point, you could use the Translate command to replace the accented characters with non-accented ones, that would work too.  But I'm still in the situation where I need to figure out how to get REXX to recognize those characters.  I'm not sure how to have REXX identify them in the code.


Joachim

Quote from: Fahrvenugen on 2011.08.18, 16:46:48
That's a good point, you could use the Translate command to replace the accented characters with non-accented ones, that would work too.  But I'm still in the situation where I need to figure out how to get REXX to recognize those characters.  I'm not sure how to have REXX identify them in the code.

Depending on the codepage you can just 'use' them. See the attached sample scripts, one can translate from and to html entities, the other upper/lowercase. The caveat is that this probably only works in the proper codepage. But istr this can be set in REXX too.

Regards,

Joachim

Fahrvenugen

Thanks, that's the type of thing I have been looking for!