• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Write a file in utf8
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Write a file in utf8
      • From: Yvan KOENIG <email@hidden>
    • Re: Write a file in utf8
      • From: Emmanuel LEVY <email@hidden>
  • Prev by Date: Re: Choose URL
  • Next by Date: Re: Write a file in utf8
  • Previous by thread: Auto: AppleScript-Users Digest, Vol 6, Issue 355
  • Next by thread: Re: Write a file in utf8
  • Index(es):
    • Date
    • Thread