On Wed, Apr 22, 2009 at 1:57 AM, Seth Willits <sli...@araelium.com> wrote:
> So, I generally know what I should do, but the problem is that I don't know
> how to identify an encoding as fixed-width or variable. I could spend the
> time to look up each and every encoding on the internet, but there are kind
> of a lot of them :) And then my code wouldn't be future-proof if an encoding
> is added.
>
>
> Can anyone offer some insight into how I could dynamically determine an
> encoding's characteristics? Or maybe I should just hard code it/do it by
> hand because there are really very few cases to handle.

Do your files have regularly occurring newlines like most normal text
files? If so, then you can just scan for a \r or \n and break it up
there. Virtually every encoding you'll encounter today encodes \r and
\n as \r and \n, and will not use those bytes for anything else.

Mike
_______________________________________________

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