Applescript reading unicode
Applescript reading unicode
- Subject: Applescript reading unicode
- From: David Jacopille <email@hidden>
- Date: 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
The em dash shows as string of three characters: a comma, a capital A with two dots above it, and a lowercase i with caret above it (don't know how to recreate on my iPad).
Script Debugger shows the "Unicode (UTF-16) text" label when viewing the data_content variable.
The em dash looks correct when the text file is opened in BBEdit.
A hex dump out of BBEdit confirms the em dash is character 2014.
My theory is that AppleScript is assuming the text it is reading is some other encoding and is doing an encoding conversion to UTF-16 that's messing it up.
Thank you for any suggestions - Dave _______________________________________________
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