Contribute  :  Calendar  :  Advanced Search  :  Site Statistics  :  Directory  :  Files to download  :  Links for developers  :  Privacy policy  :  Web Resources  :  Polls  
    MacOSX Guru Site Information, tips and tricks, FAQ for Mac OS X developers    
 Welcome to MacOSX Guru Site
 Wednesday, November 22 2017 @ 08:10 PM UTC

[NSURL path] returning nil ?

   
Cocoa Development FAQWhen 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".
 

What's Related

Story Options

[NSURL path] returning nil ? | 0 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
 Copyright © 2017 MacOSX Guru Site
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.06 seconds