|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
streamreader haltI 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;批发市场,外贸服装ü 09;发,广州服装批发,日韩 ;服装批发,广州服装批&# 21457;市场,广州外贸服装ü 09;发,台湾服装批发,上海 ;外贸服装批发,北京外&# 36152;服装批发,杭州外贸ć 81;装批发,广州 瑞丽服饰,广州瑞丽外 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. Show quoteHide quote "Guoqi Zheng" <n*@sorry.com> wrote in message news:euvqv5VJFHA.1308@TK2MSFTNGP15.phx.gbl... > 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;批发市场,外贸服装ü > 09;发,广州服装批发,日韩 > ;服装批发,广州服装批&# > 21457;市场,广州外贸服装ü > 09;发,台湾服装批发,上海 > ;外贸服装批发,北京外&# > 36152;服装批发,杭州外贸ć > 81;装批发,广州 > 瑞丽服饰,广州瑞丽外 > 6152;服 > >
AssemblyInfo - Setting some properties using static class
2 versions of assembly in GAC How to disable .NET Framework 2.0 LateBinding Coding standard question: using directive & namespace Protecting Assembly against disassembling... Process.Start - The requested lookup key was not found in any active activation context. Registry permissions revisited Process.Start - The requested lookup key was not found in any active activation context simple confirmation on XML comments ... |
|||||||||||||||||||||||