I am Posting URL Encoded data to a jsp page (Tomcat Behind) from my iphone application (Encoded using the following method):
- (NSString *)stringByAddingPercentEscapesUsingEncoding:(NSStringEncoding)enc NS_AVAILABLE(10_3, 2_0);
And String Encoding used as parameter: NSUTF8StringEncoding
But somehow that data is incorrectly decoded.
Sample Text : ¥£€>€£
Encoded: %C2%A5%C2%A3%E2%82%AC%3E%E2%82%AC%C2%A3
Received on Cell As SMS: ¥ £ Φ > Φ £
So, it seems that few characters are not encoded/decoded.
Any idea, what am i missing ?
The URI is encoded as UTF-8, but Tomcat is decoding them as ISO-8859-1. You need to edit the connector settings in the server.xml and add the
URIEncoding="UTF-8"attribute.