Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing to file as UTF8 with BOM ?



Mark J. Reed wrote:

UTF-8, on the other hand, is, as the name implies, an 8-bit encoding. It's defined in terms of bytes, not 16-bit words, so the order of those bytes is fixed. You don't need a BOM to distinguish between some hypothetical *UTF-8LE and *UTF-8BE encodings. But it still makes sense to put a BOM in a UTF-8 file to identify that file as not only Unicode text, but specifically as UTF-8 text. In fact, the UTF-8 version of the BOM, since it's 3 bytes instead of 2, is 256 times less likely than the UTF-16 BOM to appear randomly in data. It's therefore even closer to a guarantee that the file has UTF-8 text instead of something else.
i thought UTF-8 could be guessed (successfully) from the content of the file isn't it ?
Or the app writer did add BOM for UTF-8 for facility reason, having that firsts three bytes avoid the usefullness of guessing UTF-8.


best,

Yvon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >Re: Writing to file as UTF8 with BOM ? (From: Richard Rönnbäck <email@hidden>)
 >Re: Writing to file as UTF8 with BOM ? (From: "Mark J. Reed" <email@hidden>)
 >Re: Writing to file as UTF8 with BOM ? (From: Yvon Thoraval <email@hidden>)
 >Re: Writing to file as UTF8 with BOM ? (From: "Mark J. Reed" <email@hidden>)
 >Re: Writing to file as UTF8 with BOM ? (From: Yvon Thoraval <email@hidden>)
 >Re: Writing to file as UTF8 with BOM ? (From: "Mark J. Reed" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.