Write a file in utf8
Write a file in utf8
- Subject: Write a file in utf8
- From: Jay Louvion <email@hidden>
- Date: Wed, 05 Aug 2009 12:15:08 +0200
- Thread-topic: Write a file in utf8
Title: Write a file in utf8
Hi all,
I’m trying to write to a file in utf-8 format, but it doesn’t seem to work. The way I used to do it in the “old” days was thus, but it doesn’t seeem to write correctly, since quickview seems empty and the read command on the file returns a “bad ending” error.
I’m working with Leopard and here is my subroutine:
on WriteToFile(FileContent, FileLocation)
set the_file to FileLocation as file specification
try
open for access the_file with write permission
set eof of the_file to 0
write FileContent to the_file starting at eof as "class utf8"
close access the_file
on error
try
close access the_file
end try
end try
return the_file as alias
end WriteToFile
Thanks in advance for your help,
j.
Jay Louvion
Studio Casagrande
3, rue Müller-Brun
1208 Geneva
T+4122 840 3272
F+4122 840 3271
www.studiocasagrande.com
P Please consider the environment before printing this email.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden