Re: Roman Numbers
Re: Roman Numbers
- Subject: Re: Roman Numbers
- From: kai <email@hidden>
- Date: Mon, 22 May 2006 19:38:29 +0100
On 22 May 2006, at 15:55, I wrote:
On 22 May 2006, at 08:53, Takaaki Naganoya wrote:
Roman number characters in AppleScript seems wrong.
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.
[snip]
...I understand that these pre-combined glyphs are intended for use
where individual glyphs are not wanted, but are not generally meant
to replace compounded numbers.
[snip]
So, to represent the Roman numeral for 13, you'd need multiple
characters:
---------
«data utxt2169216021602160» as Unicode text
---------
And my point? ;-)
What I'd *meant* to add (before rushing off to attend to something
else) was the way I'd be tempted to count the characters - using
compounded numbers, rather than pre-combined glyphs:
---------
set aText to («data utxt216921602169216021602169216021602160» as
Unicode text) & "abc"
set b to offset of "c" in aText
--> 12
---------
The other, less logical way to approach it would be to use pre-
combined glyphs where available. But that would inevitably lead to
spurious results and confusion.
(Incidentally, Takaaki, your attached script displayed 'aText' here
as ASCII characters 133, 169, 133, 170, 133, 171, 97, 98 and 99.
Since there are 9 characters, with "c" being the last one, the result
returned was 9.)
---
kai
_______________________________________________
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