Re: How to detect application using which language by AS?
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.