Re: Read a text file
Re: Read a text file
- Subject: Re: Read a text file
- From: Emmanuel LEVY <email@hidden>
- Date: Wed, 30 Jul 2014 10:24:11 +0200
All has been said, let me contribute my 2 cents:
On Jul 29, 2014, at 9:25 PM, Gil Dawson wrote:
> Is there a way for me to tell a priori what are the EOL delimiter and encoding for the file?
There is no general way, be it a priori or a posteriori, to tell a file's encoding.
It's a matter of probability.
For instance if I write:
C'est l'été !
(French for It's summertime!) as UTF-8, of course it makes a perfectly valid UTF-8 file, but it makes also a perfectly valid MACINTOSH-encoded file, which would read:
C'est l'été !
and a perfectly valid WINDOW-8859-1-encoded file, whose contents would read:
C'est l'été !
Note that you would have an additional useful information if you knew the length of the string stored in the file. In the example above, C'est l'été ! is 13 characters while the two other strings are 15 characters long.
Emmanuel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden