• 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
Writing to file as UTF8 with BOM ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Writing to file as UTF8 with BOM ?


  • Subject: Writing to file as UTF8 with BOM ?
  • From: Richard Rönnbäck <email@hidden>
  • Date: Wed, 25 Oct 2006 21:22:53 +0200
  • Thread-topic: Writing to file as UTF8 with BOM ?

Title: Writing to file as UTF8 with BOM ?
Hi,

I have an application that requires an import file encoded as UTF8 with a leading BOM.

After examining some working files with proper encoding in BBedit I have concluded that the BOM seems to consist of three characters, so I thought I could just concatenate those with the actual data and write to file, like this:


set myBom to ((ASCII character 239) & (ASCII character 187) & (ASCII character 191))
set myString to "Hej    Hå"
set myCS to myBom & myString

set myTestFile to (open for access file "Macintosh HD:Users:richardr:Desktop:tjong.txt" with write permission)
write myCS to myTestFile as «class utf8»
close access myTestFile


However, neither that, nor any other combination I can think of seems to do the trick.

What am I missing?


Thanks in advance

// Richard
 _______________________________________________
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/mailman//archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Writing to file as UTF8 with BOM ?
      • From: "Mark J. Reed" <email@hidden>
    • Re: Writing to file as UTF8 with BOM ?
      • From: Emmanuel <email@hidden>
References: 
 >Entourage Rule to modify incoming email message source (From: Laine Lee <email@hidden>)

  • Prev by Date: Getting A Firefox Url
  • Next by Date: Re: Writing to file as UTF8 with BOM ?
  • Previous by thread: Entourage Rule to modify incoming email message source
  • Next by thread: Re: Writing to file as UTF8 with BOM ?
  • Index(es):
    • Date
    • Thread