tags:

views:

174

answers:

2

Hi all, I have problem with NSURL and Thailand language for example "http://www.xyp.com?var=ไทย" it does't work but if you use "http://www.xyp.com?var=Thai" it ok. I don't know how to solve this problem anyone please help me.

A: 

NSURL requires that all special characters be escaped.

Azeem.Butt
+1  A: 

The problem is actually with the definition of a URI. RFC3986 defines the contents of a URI and, by extension, a URL as ASCII characters so you have to encode them somehow. This is what Percent encoding is all about. The problem is that no one agrees on what bytes to encode. Some people prefer to take the raw content, convert it into UTF-8, and then encode the bytes using standard percent encoding. Others will simply encode the UCS-2 bytes directly but then you have Byte order problems.

You might want to read the UNICODE URL Decoding posting as well.

D.Shawley