Re: Applescript reading unicode
Re: Applescript reading unicode
- Subject: Re: Applescript reading unicode
- From: Nigel Garvey <email@hidden>
- Date: Wed, 28 Sep 2011 16:48:13 +0100
David Jacopille wrote on Wed, 28 Sep 2011 11:09:54 -0400:
>I'm having an encoding problem with utf-16 characters read from an
external
>text file, specifically an em dash (U+2014).
>
>Reading text file with this command in Script Debugger 4.5.7.
>
>set data_content to read file path_to_utf16_text_file
set data_content to (read file path_to_utf16_text_file as Unicode text)
The 'as' here isn't a coercion but a parameter of 'read'. It tells the
command to interpret the data in the file as UTF-16 Unicode text. For
historical reasons, 'read' assumes the UTF-16 in the file is big-endian
unless it begins with a little-endian BOM.
NG
_______________________________________________
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