I was asked by some one to show how to read a UNICODE stream.

so this is the response!

reading a unicode from a file stream is as simple as this:

/// read the stream using StreamReader — look for the constructor

/// with specified encoding !

using(System.IO.StreamReader l_rdr

= new System.IO.StreamReader(openFileDialog1.FileName,System.Text.Encoding.Unicode))

{

while( (l_strCurrent= l_rdr.ReadLine()) != null)

{

l_strBuilder.Append(l_strCurrent);

}

}

Leave a Reply

Your email address will not be published. Required fields are marked *