• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSNonLossyASCIIStringEncoding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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]
initWithData: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.


  • Prev by Date: Re: cocoa-dev digest, Vol 2 #4333 - 13 msgs
  • Next by Date: Re: How to create a easy of use Installer?
  • Previous by thread: Re: cocoa-dev digest, Vol 2 #4333 - 13 msgs
  • Next by thread: NSToolbar with multiple lines?
  • Index(es):
    • Date
    • Thread