• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Read a text file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Encrypt/Decrypt a Text File (From: Eric Geoffroy <email@hidden>)
 >Read a text file (From: Gil Dawson <email@hidden>)

  • Prev by Date: Re: random walk AS — blocking out the moves
  • Next by Date: Re: Weird behavior of text in Pages
  • Previous by thread: Re: Read a text file
  • Next by thread: Re: Read a text file
  • Index(es):
    • Date
    • Thread