Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

newformac

macrumors regular
Original poster
May 24, 2011
107
0
Hi all,

can u please help me to write a unicode text file in cocoa application?

thanks.
 
This isn't actually possible because you can't write a unicode text file. You can though write an NSString to a text file using a particular Unicode encoding. The most common encoding is UTF-8.

Check out writeToURL:atomically:encoding:error: in the NSString Class Reference. Possible encodings are listed under String Encodings in the Constants sections. For example, you write using UTF-8 by using NSUTF8StringEncoding.
 
Hi all,

can u please help me to write a unicode text file in cocoa application?

thanks.

Your question is impossible to answer until you tell us exactly what you mean by "unicode text file". Do you mean UTF-8, UTF-16, UTF-16LE or UTF-16BE, UTF32 or what? In other words, what exactly are you trying to achieve?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.