1

As the title says, I am trying to replace all extended ASCII characters by their "original" characters. So for example, I want this:

"ã é ò û ï"

to turn into this:

"a e o u i"

is there any way in java to do this?

user2988879
  • 379
  • 2
  • 6
  • 18
  • The characters themselves are, according to the system, completely different from their "original" counterparts. So `e` and `é` share nothing alike. The only way I can see this is to create a list/map of all non-"original" characters and replace all instances of them with their "original" characters. – kkirigaya Aug 02 '15 at 15:43
  • 1
    If you're trying to "sanitize" names or user input, you should fix your storage format to work with Unicode. Characters like those in your first example are very important in many languages and are usually completely distinct from the pure Roman ones they look like. I would not appreciate it if somebody, say, replaced all my Q's with O's. A Q looks like an O with an extra squiggly, but has a completely different meaning. So it is with accented letters in many non-English languages. – Ben N Aug 02 '15 at 15:44
  • @BenN I am using an API that doesn't fully support those characters. It gives the right result when using the second string, but the wrong result with the first string, even if the result itself contains extended ASCII characters. – user2988879 Aug 02 '15 at 15:47
  • @RealSkeptic yes it is a duplicate, please look at the answer and the comments on that answer – user2988879 Aug 02 '15 at 16:15
  • 1
    @user2988879 Since it is a duplicate, it should be closed as a duplicate. Providing the duplicate of the answer as a new answer is not the correct way to handle this. I have voted to close this question, and the comment above is the product of that vote. – RealSkeptic Aug 02 '15 at 16:16

0 Answers0