Hi guys,

I'm wondering how to read a text file in UTF-16 encoding that has an FFFE BOM (little endian).

I don't see any way to specify the endianness with a TextInputStream, so it seems that the solution is to use a BinaryStream like so:

    dim bstr as BinaryStream = File.OpenAsBinaryFile()
    dim b as UInt16 = bstr.ReadUInt16()
    bstr.LittleEndian = (b = &hFFFE)
    dim data as String = bstr.ReadAll(Encodings.UTF16)
    bstr.Close()

However now the compiler tells me that the method ReadAll does not exist in this class, although the documentation says that BinaryStream supports the Readable interface. Is it lying? If so, what is the right way to do this?

Thanks!

Steve

--
Steve Roy
<http://homepage.mac.com/sroy>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to