I'm dealing with my first attempt to cope with text encodings, ugh... This is an issue confronting everyone reading text files so there should be a SIMPLE solution to the problem, which is, how do I know what encoding the file is I'm opening?

First question, why is the most obvious and best solution deprecated? NSString's initWithContentsOfFile: accepts no encoding and appears it is getting the correct encoding in my tests. Now they want us to use initWithContentsOfFile:encoding:error: and figure out the encoding ourselves? Sounds like now every person is going to be writing some utilities for sniffing encodings.

I think I'm going to use initWithContentsOfFile despite Apple's wishes to do this myself but I did try the Carbon TEC manager and it appears to have created a organized list of encodings from the input bytes but it's totally wrong. The top choice was kTextEncodingJIS_X0208_90 followed by other Asian encodings for a file a plainly saved as UTF8 from TextEdit. I would say it was an error but it actually organized that list from the previous list of 200+ available encodings. Does that thing even work?

What does Apple want us to do since they deprecated the simplest solution? Thanks.

Regards,
        Josef

_______________________________________________

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

Reply via email to