On Apr 19, 2007, at 2:42 PM, Norman Palardy wrote: > > On 19-Apr-07, at 12:17 PM, Theodore H. Smith wrote: > >> 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. > > You write out the BOM using code that gets the Encoding and write out > the right BOM for that encoding > Something like > > dim te as TextEncoding > > te = Encoding(myData) > bs te.Chr(&hFEFF) > > > It's not as syntactically easy to write as your example but it's not > rocket surgery either and doesn't require a plugin. > > Some people don't like to use plugins if they can avoid them. > > Just making sure people know about alternatives where they exist
Perhaps a request to add TextEncoding.BOM() as String would be in order. Charles Yeomans _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
