• 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: How to detect application using which language by AS?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to detect application using which language by AS?


  • Subject: Re: How to detect application using which language by AS?
  • From: bill <email@hidden>
  • Date: Wed, 24 Jul 2002 12:47:15 +0800

On 24/07/2002 04:32, "Christopher Nebel" <email@hidden> wrote:

> The problem is related to it *not* being Unicode. Normal string
> constants in AppleScript get stored in the current default encoding
> (e.g., MacRoman for English and most European languages, MacJapanese for
> Japanese, etc.) with no additional information that tells you what the
> encoding is. Therefore, if you change languages, you'll get messed-up
> results, especially when switching between two radically different
> encodings like MacRoman and BIG-5. If you can manage to store all your
> strings as Unicode text, it should work correctly.

With Unicode text, the result is more complicated.

set monCoeur to "XXX" -- three double byte character
set xx to {class of monCoeur, count of character of monCoeur}
set monCoeur to monCoeur as Unicode text
set yy to {class of monCoeur, count of character of monCoeur}
{system attribute "LANG", xx, yy}

-- *SE:en {"en", {string, 6}, {Unicode text, 6}}
-- *SE:zh-TW {"en", {string, 3}, {Unicode text, 6}}
-- SE:en {"zh_TW", {string, 6}, {Unicode text, 3}}
-- SE:zh-TW {"zh_TW", {string, 3}, {Unicode text, 3}}

* SE:en means Script Editor's localized string is English
SE:zh-TW means Script Editor's localized string is Traditional Chinese

My conclusion is that using Unicode text, We've the correct result when the
system's language is a double byte language.

Anyway, most of the time I use English for applescripting :)


TIA
Bill
_______________________________________________
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.

  • Prev by Date: Re: Small FileMaker script needed!!!
  • Next by Date: Re: path to frontmost application as text but another way...
  • Previous by thread: Aatrix Mac P&L Modifing Data
  • Next by thread: Charts/Graphs - Best application for automation?
  • Index(es):
    • Date
    • Thread