Problem reading UTF8 source email from OS X Mail application
Problem reading UTF8 source email from OS X Mail application
- Subject: Problem reading UTF8 source email from OS X Mail application
- From: "Tim Barlow" <email@hidden>
- Date: Wed, 31 Jan 2007 09:52:58 +1100 (EST)
- Importance: Normal
Hi,
I'm attempting to read the 'source' of an Mail email message via the
following (simplified) script ...
tell application "Mail"
return source of message 3 of mailbox "Text"
end tell
The email in question contains some Chinese characters in UTF8 format. The
script seems to mangle these Chinese characters regardless of the coercion
I use (I've tried as Unicode text, as String, as Internation text and as
<class utf8).
The Chinese characters are represented in UTF8 by three unicode bytes
however when I received the result from the script each one of these bytes
is represented by two or more bytes as if a secondary unicode conversion
has happened for example
original Unicode character = µ
represented as Unicode bytes = 232 142 138
result of script = (195 168) (194 142) (194 138)
However, the script ..
tell application "Mail"
return content of message 3 of mailbox "Text"
end tell
will work correctly, ie. the Chinese unicode characters are preserved.
Finally, this behaviour also occurs with Eudora indicating that it may be
an AppleScript/AppleEvent problem.
I'd really appreciate it if you could shed some light on whats happening
here and how I may work around the problem,
Many thanks for your help.
Best regards .... Tim
_______________________________________________
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/mailman//archives/applescript-users
This email sent to email@hidden