Re: 'sort' command-alternative?
Re: 'sort' command-alternative?
- Subject: Re: 'sort' command-alternative?
- From: John Delacour <email@hidden>
- Date: Sun, 6 Oct 2002 20:34:06 +0100
- Mac-eudora-version: 5.3 alpha
At 11:19 am -0700 6/10/02, Paul Berkowitz wrote:
On 10/6/02 10:29 AM, I wrote:
set pair to read file f
--> "a" [as plain text, new method]
Nope. There are actually 4 characters there:
set pair to read file f
set cc to count pair
--> 4
set {c1, c2, c3, c4} to pair's {character 1, character 2, character 3,
character 4}
--> {"", "", "", "a"}
With HIRIGANA LETTER A - Unicode 3042 according to the character palette, s
is "0B" [as Unicode text] , pair is "0B" and
{c1, c2, c3, c4} = {"", "0", "", "B"}
--Is this 4-byte Unicode-16?
It's not Unicode and there's no such thing as Unicode-16.
Type your hiragana character into a TextEdit window and run the
script below. In the dialog, you should see
[capital C with cedilla, dagger]
Unicode text
あ (= あ)
And in the new window that opens you should see the same character.
If you don't, then I have nothing to suggest, because it works here
every time with ANY UTF-16 character.
tell app "TextEdit" to set s to get character 1 of document 1
set f to ":tmp:junk.txt"
set f2 to ":tmp:junk.html"
open for access file f with write permission
set eof file f to 0
write s to file f
close access file f
--
set pair to read file f
set n to 256 * (ASCII number (character 1 of pair))
set n to n + (ASCII number (character 2 of pair))
set htmlChar to "&#" & n & ";"
display dialog "" default answer return & s & "
" & class of s & return & htmlChar
--
open for access file f2 with write permission
set eof file f2 to 0
write "<html>" & htmlChar & "</html>" to file f2
close access file f2
tell app "Finder" to open file f2
_______________________________________________
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.