Re: Writing to file as UTF8 with BOM ?
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