Re: Corce alias with Unicode (Japanese) to string fails
Re: Corce alias with Unicode (Japanese) to string fails
- Subject: Re: Corce alias with Unicode (Japanese) to string fails
- From: Emmanuel <email@hidden>
- Date: Thu, 14 Oct 2004 09:32:43 +0200
At 2:33 PM +0900 10/14/04, SS Factory wrote:
on Wed, 13 Oct 2004 18:34:51 +0900, Takaaki Naganoya wrote:
----Right pattern in converting Japanese file name as Unicode
> tell application "Finder"
set a to choose file
set b to name of a
end tell
set b1 to b as string--this operation is very important
set b2 to b1 as Unicode text
set c to count every character of b2
-----------------------------------------------------------
This script fails when the file name contains surrogate pair.
It returns wrong result if you choose the file created by following script.
tell application "Finder"
make new document file at desktop with properties {name:<<data
utxtD842DFB7>>}
end tell
Coercing alias to unicode text also fails when the file name or path
contains surrogate pair.
I hope this will be fixed in next release of AppleScript.
This works on my machine (10.2.8).
tell application "Finder"
make new document file at desktop with properties {name:«data
utxtD842DFB7»}
end tell
tell application "Finder"
set a to (choose file) as file specification
set b to name of a
end tell
-- this requires Smile
set text of (make new Unicode window) to b
-- the window displays the correct character
Emmanuel
_______________________________________________
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