• 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
any way to determine the encoding type of an NSData object?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

any way to determine the encoding type of an NSData object?


  • Subject: any way to determine the encoding type of an NSData object?
  • From: Donald Hall <email@hidden>
  • Date: Sun, 4 Jan 2004 00:37:38 -0700

I want to load data from files that are either encoded with
NSMacOSRomanEncoding or NSUnicodeEncoding. I am converting the
documents my program creates to use Unicode so that say Japanese
users can use Kanji characters. Existing users will have documents
saved as MacOSRoman and they won't be able to correctly open them in
the new version of my program.

I'm using the NSDocument method:

- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)type

Is there a way to determine what encoding type was used when the
document was saved? NSData does not seem to have a way to determine
this.

Am I going to have to supply a separate conversion utility?

Thanks,

Don
--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
email@hidden
http://www.appsandmore.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.

  • Follow-Ups:
    • Re: any way to determine the encoding type of an NSData object?
      • From: p3consulting <email@hidden>
  • Prev by Date: Re: Document based app problems
  • Next by Date: Re: NSImage drawing woes
  • Previous by thread: Re: NSImage drawing woes
  • Next by thread: Re: any way to determine the encoding type of an NSData object?
  • Index(es):
    • Date
    • Thread