NSStrings, C strings, pathnames and encodings in iPhone

Posted by iter on Stack Overflow See other posts from Stack Overflow or by iter
Published on 2010-04-28T06:15:37Z Indexed on 2010/04/28 6:23 UTC
Read the original article Hit count: 279

I am using libxml2 in my iPhone app. I have an NSString that holds the pathname to an XML file. The pathname may include non-ASCII characters. I want to get a C string representation of the NSString for to pass to xmlReadFile(). It appears that cStringUsingEncoding gives me the representation I seek. I am not clear on which encoding to use.

I wonder if there is a "default" encoding in iPhone OS that I can use here and ensure that I can roundtrip non-ASCII pathnames.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about libxml2