convert unicode text to code point
convert unicode text to code point
- Subject: convert unicode text to code point
- From: bill <email@hidden>
- Date: Mon, 16 Jan 2006 06:47:16 +0800
Hello,
Last week I re-read an old thread "Re: Producing Unicode-only
characters" and found that Niger suggested an exploitation of the
single-record-list-to-string coercion bug:
<http://lists.apple.com/archives/applescript-users/2005/Oct/
msg00840.html>
which's a quite different way for converting unicode text to code
point than the temporary file approach.
After some experimentations, some interesting stuffs:
-- script
set uText to ("z" as Unicode text)
set gText to {{a:uText}} as string
-- visually, the result is "dle2TEXT0usrflistTEXTAutxtz"
However, if we try:
-- script
set uText to ("z" as Unicode text)
set gText to {{a:uText}} as string
set gList to {}
repeat with i in (characters of gText)
set end of gList to {(contents of i), ASCII number (contents of i)}
end repeat
gList -- {{"d", 100}, {"l", 108}, {"e", 101}, {"2", 50}, {"