On Feb 2, 2009, at 11:25 PM, Seth Willits wrote:

On Feb 2, 2009, at 7:50 PM, Joar Wingfors wrote:

Before opening the file, either determine, guess, or be told what the encoding is. With that encoding, convert your delimiter string into raw bytes, then do byte-for-byte comparison on the file to find occurrences of that delimiter.

How do you know what delimiter string to use?

Well the original poster said he wants to read lines. So \r, \n, or \r\n is your delimiter. It depends on your usage.


As well as unicode LINE SEPARATOR (0x2028), and PARAGRAPH SEPARATOR (0x2029), which are recognized as line separators by NSString's getLineStart:end:contentsEnd:forRange and friends (if the file is one of several unicode encoding).



Glenn Andreas                      gandr...@gandreas.com
 <http://www.gandreas.com/> wicked fun!
Mad, Bad, and Dangerous to Know

_______________________________________________

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