NSNonLossyASCIIStringEncoding
NSNonLossyASCIIStringEncoding
- Subject: NSNonLossyASCIIStringEncoding
- From: Fred Norbett <email@hidden>
- Date: Wed, 9 Jun 2004 16:50:25 -0700 (PDT)
I distributed a small application to two coworkers to
convert certain types of text into data for our own
use. Text gets stored in an NSDictionary, and then
converted to an NSData object using
dataUsingEncoding:. This then gets written to file.
I originally had used NSASCIIStringEncoding for
maximum compatbility, but then got a couple of mutters
about characters being lost; so I changed to
NSNonLossyASCIIStringEncoding. No problems there.
It's been this way for a couple of revisions now, and
text gets imported into other text tools fine.
However, we recently tried to open some of the
NSNonLossyASCIIStringEncoding files to work with
again...
NSString initWithContentsOfFile: fails to open the
file. The data can be read in by using NSData
initWithContentsOfFile, but this NSData object cannot
then be converted back to text; [[NSString alloc]
initWith
Data:theData
encoding:NSNonLossyASCIIStringEncoding] produces a
null string.
Is this intended behavior? Is
NSNonLossyASCIIStringEncoding meant to only produce
text for screen use? Is there any way of converting
data saved with this encoding back to ASCII text?
Help!
I've started saving stuff as NSUnicodeStringEncoding
now. I wish I'd done that earlier...
/Fred
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.