• 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
Determine encoding of file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Determine encoding of file


  • Subject: Determine encoding of file
  • From: Dave DeLong <email@hidden>
  • Date: Fri, 30 Jul 2010 16:09:22 -0600

Hi everyone,

I have a seemingly simple question, but I haven't been able to figure it out.

Given a file, how can I determine the NSStringEncoding of the file, without reading the entire file into memory?  (If the file isn't a text file, then defaulting to NSUTF8StringEncoding is just fine, since my code will only work properly if I'm working with text files anyway)

I've found this: http://www.macosxguru.net/article.php?story=20030808081801868 but it seems ridiculously complex...

Thanks,

Dave

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Determine encoding of file
      • From: Michael Watson <email@hidden>
    • Re: Determine encoding of file
      • From: Martin Wierschin <email@hidden>
    • Re: Determine encoding of file
      • From: John Pannell <email@hidden>
    • Re: Determine encoding of file
      • From: Kyle Sluder <email@hidden>
    • Re: Determine encoding of file
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: Intercepting deletion of NSManagedObjects or how to handle deletion in non-explicit relationships?
  • Next by Date: Re: Determine encoding of file
  • Previous by thread: Re: [iPhone] Nib Loading Question
  • Next by thread: Re: Determine encoding of file
  • Index(es):
    • Date
    • Thread