Q:

Format NSString (Char-Replacement, UTF, ...)

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 ...)
&auml; -> ä
&ouml; -> ö
&uuml; -> ü
&Auml; -> Ä
&Ouml; -> Ö
&Uuml; -> Ü
&szlig; -> ß
&quot; -> "
\u00C4 -> Ä
\u00E4 -> ä
\u00D6 -> Ö
\u00F6 -> ö
\u00DC -> Ü
\u00FC -> ü
\u00DF -> ß

A:

– stringByTrimmingCharactersInSet:
NSString *str = @"  Frankfurt an der Oder   ";
NSString *trimmed = [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSLog(@"\"%@\"", str);
NSLog(@"\"%@\"", trimmed);

2012-03-26 14:10:49.302 xx[3752:f803] "  Frankfurt an der Oder   "
2012-03-26 14:10:49.333 xx[3752:f803] "Frankfurt an der Oder"

about the ü. Does the \U00fc appear 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. 

