Re: Really big files and encodings
Re: Really big files and encodings
- Subject: Re: Really big files and encodings
- From: Michael Ash <email@hidden>
- Date: Wed, 22 Apr 2009 11:09:26 -0400
On Wed, Apr 22, 2009 at 1:57 AM, Seth Willits <email@hidden> 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 (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