OS2 World.Com Forum
2012.05.24, 08:06:44 *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Detecting french accents  (Read 1861 times)
Fahrvenugen
Full Member
***
Posts: 201


View Profile
« on: 2011.08.17, 23:53:47 »

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
Logged
ivan
Hero Member
*****
Posts: 562


View Profile
« Reply #1 on: 2011.08.18, 02:13:48 »

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
Logged
Fahrvenugen
Full Member
***
Posts: 201


View Profile
« Reply #2 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.

Logged
Joachim
Newbie
*
Posts: 36


View Profile
« Reply #3 on: 2011.08.18, 17:59:32 »

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
Logged
Fahrvenugen
Full Member
***
Posts: 201


View Profile
« Reply #4 on: 2011.08.22, 18:18:11 »

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

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!