Google Maps API delivers me a string which contains the German letters: ö, ä , ü and probably several other special characters.
The string looks like:
@" (several spaces ...) Frankfurt an der Oder (several spaces ...) "
(1) If I try stringByReplacing ... and make the spaces disappear, it looks like:
@"FrankfurtanderOder" … which is even worse. So I need to delete the spaces before the first and after the last word, not the spaces in between. How to do this?
(2) Sometimes Google delivers me @"W\U00fcrzburg, Deutschland"
… there is nothing said in the JSON-request about encodings … could it be that the JSON-parser and not the api is the problem?
However, still I have to solve it. Any ideas?
Thank you so far!
EDIT:
For (2) I’ll do the workaround and replace some UTF-8 characters … (Even If this is definitely not the best solution …)
ä -> ä
ö -> ö
ü -> ü
Ä -> Ä
Ö -> Ö
Ü -> Ü
ß -> ß
" -> "
\u00C4 -> Ä
\u00E4 -> ä
\u00D6 -> Ö
\u00F6 -> ö
\u00DC -> Ü
\u00FC -> ü
\u00DF -> ß
– stringByTrimmingCharactersInSet:about the ü. Does the
\U00fcappear in an UILabel or did you just got them from a NSLog? In my experience sometimes NSLog doesn’t print the decoded letters but they appear okay in interface elements.