I am sending text from iphone to the server for processing. The text contain some spanish characters eg, á é í ó ú ü ñ ¿ ¡ ºª
While sending, I am encoding it with NSUTF8StringEncoding Server side is also using UTF8 encoding to decode it.
But the server side decodes it as ???????
Please let me know if anyone has faced this issue and how this was resolved ?
Thanks.
I found the solution.
Since this is a post data I had to escape the special characters.
stringByAddingPercentEscapesUsingEncoding:
doesn't seem to escape all the special characters. I faced this issue with "+" character where it was getting replaced by a whitespace.I feel same thing happens with spanish character where it is not escaped properly, so I manually replaced it and it worked.
following is an example. I wrote this for all the characters
Thank you xj1200 and saadnib for looking in to this. I really appreciate. If you guys find any other better solution please post.
I think you can use Google Toolbox for Mac for ancoding these characters. See files GTMNSString+
http://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/?r=27#trunk%2FFoundation