streamreader halt

  • Thread starter Thread starter Guoqi Zheng
  • Start date Start date
G

Guoqi Zheng

Dear sir,

I am using streamreader to read and process some text file. Some times,
those text file contains special characters such as Chinese. StreamReader
will halt when reading those special characters. Does some one know what
happen?

Here is what I used.
Dim sr As StreamReader = New StreamReader(FileName, New
System.Text.UTF8Encoding)

rStr = sr.ReadToEnd

sr.Close()



Below is an example of the text file.

服装批发,批发服装,服&#
35013;批发市场,外贸服装&#252
09;发,广州服装批发,日&#38889
;服装批发,广州服装批&#
21457;市场,广州外贸服装&#252
09;发,台湾服装批发,上&#28023
;外贸服装批发,北京外&#
36152;服装批发,杭州外贸&#263
81;装批发,广州
瑞丽服饰,广州瑞丽外&#3
6152;服
 
I haven't got much experience with localization issues, but I'd imagine that
your problem is because of your encoding. To use Unicode characters, you
should have a Unicode encoding, rather than UTF8.
 
Back
Top