javalanguage-translation

Comparing German word with umlauts with same word with unicode


I'm working on translating Strings from English to German, but German words that are already translated are being translated again.

Say I have this word "Beim Hinzuf\u00E4gen" which has already been translated. I want to compare this to the same word but with umlauts, "Beim Hinzufügen". Both files are read as ISO-8859-1, but when I compare the words they are seen as being different and the word is translated again which I don't want. Even when I replace the Umlaut with the unicode and compare the two, they are still seen as different. I'm sure this is because when I replay the umlaut by "\u00E4", there's an extra backslash being added in.

Anyone have an idea of the preferred method for what I'm trying to do.


Solution

  • As @Eugene points out, your result ist correct. You compare "Hinzufügen" with "Hinzufägen", which are different.

    Unicode 00E4 is "ä",
    Unicode 00FC is "ü".