Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Remove special characters in string

Former Member
0 Likes
6,133

Hi all,

I'm Portuguese, and in our language we use special characters in words like "João or "Sónia".

I need to take off these special characters, which means I want to have the same words like "Joao" and "Sonia", without the characters "~" or "´".

Do you have any idea how can I do this?

Thanks in advance.

Best regards,

Sónia Gonçalves

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,289

Check out this function SCP_REPLACE_STRANGE_CHARS

11 REPLIES 11
Read only

Former Member
0 Likes
2,289

hi,

language which are viewing is depending on your language at login time. Try to login with "EN" as Language selection you will get the desired output.

Read only

Former Member
0 Likes
2,289

for this use the replace all occurances

Read only

Former Member
0 Likes
2,289

for this use the replace all occurances of

data:char(5) value 'Sónia'.

replace all occurrences of 'ó' in char with 'o' .

write: char.

Read only

0 Likes
2,289

Hi,

But I want to make this generic, I don't want to replace character by character.

If I give a string in the program, I want to search all ocurrences of these special characters and replace them.

How can I do this?

Thanks.

Best regards,

Sónia Gonçalves

Read only

matt
Active Contributor
0 Likes
2,289

>I don't want to replace character by character

TRANSLATE string USING 'ÑNñnÓOóo...'.

matt

Read only

Former Member
0 Likes
2,290

Check out this function SCP_REPLACE_STRANGE_CHARS

Read only

matt
Active Contributor
0 Likes
2,289

> Check out this function SCP_REPLACE_STRANGE_CHARS

Very nice. But it replaces Ö Ä Ü with Oe Ae Ue instead of OE AE UE

Seems great with Portugese accents though.

Read only

0 Likes
2,289

Maybe it's the codepage? I've only use it to remove accents and the ñ

Read only

0 Likes
2,289

Hi,

The function SCP_REPLACE_STRANGE_CHARS is just what I need!!

Thank you very much for your help!!

Best regards,

Sónia Gonçalves

Read only

matt
Active Contributor
0 Likes
2,289

It's absolutely correct to replace Ö with OE. My point was it's replacing them with Oe.

Read only

matt
Active Contributor
0 Likes
2,289

Sonia -> The points should have gone to Ramiro Escamilla, not me.

matt