Hi All,
I am facing a problem while replacing special characters in java mapping.
requirement is: we ned to replace the characters as given below:
à a À A
â a  A
ç c Ç C
é e É E
è e È E
ê e Ê E
ë e Ë E
î i Î I
ï i Ï I
ô o Ô O
ù u Ù U
û u Û U
the problem is, when i execute the java map , it changes the encoding automatically to UTF 8 which convert these characters to some weired combionations for exp:
é is represented as é, in UTF 8
And i had to search for these characters i.e to replace Ê : a= a.replaceAll("Ê","E");
// é,è,ë,ê = é,è,ë,ê
// í,ï = Ã,ï
// ó,ô = ó,ô
// ù,û = ù,û
// Ä = Ä
// Ö = Ö
// Ü = Ü
// ê = ê
is there any simple way i can maintain the ISO encoding in the java map or replace these special characters with normal english characters?
Request clarification before answering.
Hi,
You can use the symbolic codes for each character, e.g. à is symbolized by \u00F0. You can find the complete list of unicode symbols for different characters e.g. here:
List of Unicode characters - Wikipedia, the free encyclopedia
Some more info on how to replace unicode-based characters with Java code e.g. here:
Replacing Unicode character codes with characters in String in Java - Stack Overflow
Regards,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 10 | |
| 5 | |
| 5 | |
| 5 | |
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.