Re: Roman Numbers
Re: Roman Numbers
- Subject: Re: Roman Numbers
- From: "Mark J. Reed" <email@hidden>
- Date: Mon, 22 May 2006 09:28:56 -0400
On 5/22/06,
Takaaki Naganoya <
email@hidden> wrote:
Roman number characters in AppleScript seems wrong.
<sample>
set aText to "XIXIIXIIIabc" as Unicode text
set b to offset of "c" in aText
--> this script returns 10 on Mac OS X
10.4.6 Japanese Environment
-- I think this should be 6.
</sample>
The string above is [ "X", "I", "X", "I", "I" ] etc; just coercing it to "Unicode text" isn't going to change what characters it contains. If you want it to consist of "ROMAN NUMERAL ELEVEN", "ROMAN NUMERAL TWELVE", etc (not sure what you expect "XIII" to turn into, since there is no "ROMAN NUMERAL THIRTEEN" in Unicode. TEN + THREE? ELEVEN + TWO? TWELVE + ONE?), then you have to put those characters in the string in the first place.
With Script Editor I don't think you can enter Unicode text directly, but there are extensions which provide the equivalent of the "ascii" functions for Unicode, so you could build up a string that way with "unicode character 8554 & unicode character 8555", etc. And other environments do have support for Unicode source.
--
Mark J. Reed <
email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Roman Numbers (From: Takaaki Naganoya <email@hidden>) |