|use AppleScript version "2.4"
use scripting additions
use framework "Foundation" set aStr to "高島屋"
set aPath to choose file name set cStr to current application’s NSString’s stringWithString:aStr
set thePath to POSIX path of aPath set aRes to cStr’s writeToFile:thePath atomically:false encoding:(current application’s NSUTF8StringEncoding) |error|:(missing value)
set dFol to (path to desktop) as string
set fullPath to dFol & "test_utf8.txt"
set aStr to "髙島屋"
set fRes to writeToFileAsUTF8(aStr, fullPath, false) of me on writeToFileAsUTF8(thisData, targetFile, appendF as boolean)
tell current application
set the targetFile to the targetFile as text
set the openTargetFile to open for access file targetFile with write permission
if appendF is false then set eof of the openTargetFile to 0
write thisData to the openTargetFile as «class utf8» starting at eof
close access the openTargetFile
close access file targetFile