I am using google's translate API to translate some text in the iPhone SDK. The URL I use is http://ajax.googleapis.com/ajax/services/language/translate?v=1.0
Everything works, except in some languages, Polish for example, the returned string sometimes have weird things like \u0026 as part of the string. It would show as "hello how ar\u0026e you". Why is this? The way I fetch for the result is as follows:
NSData *returnData = [NSURLConnection sendSynchronousRequest: req returningResponse: response error: error];
NSString *new = [[NSString alloc] initWithData:responseData encoding: NSUTF8StringEncoding];
Is the encoding incorrect? Is that why the new string appears to be incorrect? I've tried the same text int he google translate webpage and it gets translated correctly.
UPDATE
If you simply go to this URL, you will see the special characters. How do I correctly represent those characters in my app? Using the two lines of code above will not encode it correctly.