Re: Unicode characters
Re: Unicode characters
- Subject: Re: Unicode characters
- From: Christopher Nebel <email@hidden>
- Date: Tue, 8 Apr 2003 21:45:19 -0700
On Tuesday, April 8, 2003, at 08:52 AM, John Delacour wrote:
At 9:44 am +0200 8/4/03, Jonas Salling wrote:
I'd like to build a string with a Unicode paragraph end character in
it. I was hoping there'd be something like this available:
"a" & (unicode character 2029) & "b"
This, however, doesn't seem to be the case. Am I missing something?
"a" is not a unicode character and nor is "b"
JD is being a bit cryptic. What he means (I think) is that the
AppleScript constant "a" is of type string, not Unicode text. "a" and
"b" are both Unicode characters in that there are Unicode code points
for them, of course.
The write-to-a-file stunt works anywhere; if you're on Mac OS X, you
can use do shell script and Perl to achieve the same end:
set parasep to (do shell script "perl -e 'print \"\\x{2029}\"'")
It's slower than writing a file, but a lot neater.
It's possible in some cases to use a constant like <<data utxt0209>>,
but it's extremely twitchy and tends to crash. (I've filed a bug.)
Beware that you'll need to start with Unicode text on the left-hand
side of &, or your lovely Unicode character will get coerced to an
old-style string, which might destroy the original character.
A future version of AppleScript will make it possible to create Unicode
string constants in a sane manner.
--Chris Nebel
Apple Development Tools
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.