[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [DotGNU]how to find ByteOrder Marks
From: |
Gopal V |
Subject: |
Re: [DotGNU]how to find ByteOrder Marks |
Date: |
Wed, 5 Mar 2003 19:43:01 +0530 |
User-agent: |
Mutt/1.2.5i |
If memory serves me right, minddog wrote:
> I don't know how to find these marks from a streamFragment since I am unsure
> if there is a class that already does this. Anyone help me out here? =)
>
> // TODO: find byte order mark
> // // EF BB BF = utf8
> // // FE FF = utf16/ucs-2 little endian
> // // FF FE = utf16/ucs-2, big endian
> // // FF FE 00 00 = UTF-32/ucs-4, little endian
> // // 00 00 FE FF = UTC-32/UCS-4, big endian
> // else ...
> // encoding = System.Text.UT8Encoding(true);
Check the System.IO.StreamReader for its DetectByteOrder() private
function. IMHO it should be a great help . But this process needs
to use some kind of buffering.
That aside , you could use StreamReader for all places you need to
read a stream with Encoding :-)
Gopal
--
The difference between insanity and genius is measured by success