Re: Trouble with Unicode text
Re: Trouble with Unicode text
- Subject: Re: Trouble with Unicode text
- From: Jeffrey Mattox <email@hidden>
- Date: Wed, 26 Feb 2003 20:20:45 -0600
John:
Thanks. I don't know much about Unicode.
Do you have any idea what setting(s) might affect this? Something
must have changed between this working and it not working. For weeks
everything was fine. I did poke through my System Preferences, but
didn't change anything (at least not intentionally).
A sigma (option-w) in my code looks okay, but at runtime the value is
wrong. The characters I type into my text fields at runtime don't
match the coding of the characters I type into my program at compile
time, and I'm using the exact same keystrokes and the character looks
the same in both places.
Currently, my settings are:
System Preferences:
International, Language, Languages: English
International, Language, Script, Roman: Behaviors = English
Project Builder:
Preferences, Default encoding: System default (Western (MacOS Roman))
(I tried Unicode UTF-16 and Unicode UTF-8, with no effect)
Alternatively, how do I force a UTF-16 comparison in a statement like
this (where "x" is my option-w character):
if ( thechar is "x" ) then ...
Jeff
On Wednesday, February 26, 2003, at 11:32 pm, Jeffrey Mattox wrote:
Sometimes, the string contains Greek characters, e.g., (sigma, Option-w).
Strictly speaking that character ( ∑ or ∑ ) is not Greek
and not Sigma but
* Character Name: N-ARY SUMMATION
* Block: Mathematical Operators
Greek capital letter sigma is ̓ by the way.
When I get the input string via the text field, a sigma looks like:
log(theChar) -- "\\u2211"
log((class of theChar) as string) -- "Unicode text"
log(length of theChar) -- 1
That's the character in UTF-16 -- it's a single character but two bytes.
set theChar to "" as string
log(theChar) -- "\\u201a\\340\\353"
log((class of theChar) as string) -- "string"
log(length of theChar) -- 3
That's the UTF-8 encoding of the character, namely
option-shift-0 + small a with grave accent + small e with diaeresis
JD
_______________________________________________
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.
_______________________________________________
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.