• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Trouble with Unicode text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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 ( &sum; or &#x2211; ) is not Greek and not Sigma but

* Character Name: N-ARY SUMMATION
* Block: Mathematical Operators

Greek capital letter sigma is &#x0343; 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.

  • Follow-Ups:
    • Re: Trouble with Unicode text
      • From: John Delacour <email@hidden>
References: 
 >Re: Trouble with Unicode text (From: John Delacour <email@hidden>)

  • Prev by Date: Re: Trouble with Unicode text
  • Next by Date: Re: Path to me (was: "open" command without full path (OS 9))
  • Previous by thread: Re: Trouble with Unicode text
  • Next by thread: Re: Trouble with Unicode text
  • Index(es):
    • Date
    • Thread