Re: Read a text file
Re: Read a text file
- Subject: Re: Read a text file
- From: Stan Cleveland <email@hidden>
- Date: Wed, 30 Jul 2014 14:01:20 -0700
On Jul 30, 2014, at 12:05 PM, Gil Dawson wrote: But can read srtFile diagnose encodings?
Hi Gil,
I've never found documentation of just exactly what rules are used by read file to determine encoding. But I'd guess that it checks first for a BOM, then defaults to UTF-8 otherwise.
If you know the format of the text file, you can instruct read file to utilize a specific UTF encoding: set docLines to paragraphs of (read srtFile as «class utf8») -- reads as UTF-8 set docLines to paragraphs of (read srtFile as Unicode text) -- reads as UTF-16
HTH, Stan C.
|
_______________________________________________
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