Hi there,
I'm having strange encoding issue converting NSString to UTF8 cString. I'm fetching XML data from webserver. XML is correctly encoded with UTF-8 encoding. After fetching data, I convert it to NSString as follows:
NSString *XMLdata = [[[NSString alloc] initWithData: receivedData encoding: NSUTF8StringEncoding] autorelease];
When I write the result to the stdout with NSLog, output appears to be ok (all characters are readable).
But when I try to get cString with [XMLData UTF8String] or [XMLDdata cStringWithEncoding: NSUTF8StringEncoding], non-ascii characters (german in this case) are screwed (for instance "N√ºrnberg" instead of "Nürnberg").
I do not have any idea what's wrong with that. Am I missing something or is that some bug?
Any help is appreciated, thanks! Matthes