cancel
Showing results for 
Search instead for 
Did you mean: 

Umlauts(special character replacement)

Former Member
0 Kudos

Hi All

I have the requirement where I need to convert Umlauts(special characters in foreign language like Ü,Ö )to plain simple english like ue , oe.

I use the following code to do the conversion:

String specialChar[]={"Ä","Ö","ö","ü","ä","Ü","

",":",":"};

String htmlChar[]={"AE","OE","oe","ue","ae","UE","","",""};

for(int i=0;i);

}

This work fine while testing in Eclipse and the umlauts get converted to english alphabets.

However after importing to PI as an archive, it looks like :

String specialChar[]={"�","�","�","�","�","�","

",":",":"};

String htmlChar[]={"AE","OE","oe","ue","ae","UE","","",""};

for(int i=0;i);

}

And if we test it in Interface mapping,No conversion happens.

Can anyone tell me why it fails in PI and how to resolve this issue?

Accepted Solutions (0)

Answers (3)

Answers (3)

stefan_grube
Active Contributor
0 Kudos

Check your codepage settings in Eclipse editor.

It should be UTF-8

eduardo_hinojosa
Active Contributor
0 Kudos

Hi,

Check the function module ES_REMOVE_SPECIAL_CHARACTER as a model.

Regards,

Eduardo

Former Member
0 Kudos

Hi Itisha,

Perhaps the code didnu2019t get copy/pasted completely into your forum message, but please try the following:


for(int i=0;i<htmlChar.length;i++) {
	trace.addWarning("index of [" + specialChar<i> + " is [" + dataType.indexOf(specialChar<i>) + "]");
	dataType=dataType.replaceAll(specialChar<i>,htmlChar<i>);
}		

The question marks indicate a display issue and may not be a real issue. I would try the transformation again with the code above.

Thanks,

-Russ