MACSCRPT Archives

January 2011

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Mark J. Reed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 11 Jan 2011 13:17:57 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (43 lines)
On Tue, Jan 11, 2011 at 12:34 PM, John Delacour <[log in to unmask]> wrote:
>
>> Hey JD, you would probably know this procedure: I see a Unicode
>> character on a Web page <http://www.ytn.co.kr/>, in this case a black
>> triangle (like "[>"), and want to find out what code point it is. So
>> I copied to the clipboard and wrote a script to try and convert it
>> using something like this:
>>
>> item 1 of ((((theU as «class ut16») as string) as record) as list)

Yowza!
Assuming you're in AS 2.0, all you need is this:

id of (the clipboard as text)

For your triangle, copied from the web page you gave, that gives me
9654, which is hex 25B6.

> Perl will do it easily as well.

For example, assuming you have your Terminal environment set up for
UTF-8, you can run this in a terminal and paste the character:

perl -Mencoding=utf8 -e 'printf "%04x\n", ord <>'

The Perl installation is also a good place to look for characters by name:

$ grep RIGHT.*TRIANGLE$ /System/Library/Perl/5.10.0/unicore/NamesList.txt
22BF    RIGHT TRIANGLE
25B6    BLACK RIGHT-POINTING TRIANGLE
25B7    WHITE RIGHT-POINTING TRIANGLE
25B8    BLACK RIGHT-POINTING SMALL TRIANGLE
25B9    WHITE RIGHT-POINTING SMALL TRIANGLE
25E2    BLACK LOWER RIGHT TRIANGLE
25E5    BLACK UPPER RIGHT TRIANGLE
25F9    UPPER RIGHT TRIANGLE
25FF    LOWER RIGHT TRIANGLE
29CE    RIGHT TRIANGLE ABOVE LEFT TRIANGLE
29D0    VERTICAL BAR BESIDE RIGHT TRIANGLE

--
Mark J. Reed <[log in to unmask]>

ATOM RSS1 RSS2