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

Re: Writing to file as UTF8 with BOM ?


  • Subject: Re: Writing to file as UTF8 with BOM ?
  • From: "Mark J. Reed" <email@hidden>
  • Date: Wed, 25 Oct 2006 15:40:37 -0400

The BOM is not three characters.  It's one character.  In UTF-8, that
character becomes three bytes with the numeric values you indicated.

But what you're doing is building a Unicode string with the three
*characters* represented by those numeric values, and then encoding
that string as UTF-8, which turns each of those characters into a
two-byte sequence.

Remember, in Unicode, bytes and characters are not the same thing.

I think it will work if you write the BOM separately, without using class utf8:

 write myBOM to myTestFile as string
 write myString to myTestFile as «utf8»
 close access myTestFile

But I haven't tested that.

--
Mark J. Reed <email@hidden>
 _______________________________________________
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

References: 
 >Entourage Rule to modify incoming email message source (From: Laine Lee <email@hidden>)
 >Writing to file as UTF8 with BOM ? (From: Richard Rönnbäck <email@hidden>)

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