[NSURL path] returning nil ?

Sunday, August 27 2006 @ 09:07 AM BST

Contributed by: Admin

When percent escaping some accentued characters in string constants passed to the URLWithString method, the path method returns nilů what's happening here ?

When decoding percent escapes, the NSURL class assumes UTF-8 encoding.
Examples :
à is 0xE0 in ISO-8859-1 and 0x00E0 in Unicode but 0xC3 0xA0 in UTF-8, so encoding in a NSString constant should be @"%C3%A0" and not @"%E0".