> On 19-Apr-07, at 4:39 AM, Theodore H. Smith wrote: > >> Firstly, high-ascii doesn't exist. >> >> And secondly, what you want is the UTF-8 BOM. >> >> ElfData users are spoilt here. An ElfData user does this: >> >> bs.Write myData.BOM >> bs.Write myData // :) >> >> Without ElfData you gotta write a few bytes. I forgot which though. >> >> Maybe it's #xEF #xBB #xBF > > Just write out Encodings.UTF8.Chr(&hFeFF) // FEFF is the Unicode BOM > and it gets written out in the correct endianess that the text file > is in
That's one way, yes. It's still more to remember. You need to remember a "magic number". Also, what if the data is UTF-16? Or UTF-16LE or UTF-16BE? How will his binary stream handle that? ElfData manages all that via the .BOM function. You don't need to remember anything, other than to call .BOM. It's very simple. -- http://elfdata.com/plugin/ "String processing, done right" _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
