At 16:06 -0700 30/07/10, cocoa-dev-requ...@lists.apple.com wrote: >From: Dave DeLong <davedel...@me.com> >Date: Fri, 30 Jul 2010 16:09:22 -0600 >Message-ID: <c4c3f14d-e591-4551-864a-2f0b8d5b0...@me.com> >... >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)
Beyond what others have already answered, one example heuristic can be found in this sample code: http://brockerhoff.net/src/FolderSweep.zip check the last method in AppController.m. HTH, -- Rainer Brockerhoff <rai...@brockerhoff.net> Belo Horizonte, Brazil "In the affairs of others even fools are wise In their own business even sages err." Blog: http://brockerhoff.net/blog _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com