Home All Groups Group Topic Archive Search About

How to work with the special characters

Author
2 Aug 2006 9:53 AM
Li Pang
Hi,

I read a text file line by line, and put the value into a arraylist. But
some special characters lost after asignment. Is there any solution to avoid
this?

Thanks in advance

Author
2 Aug 2006 12:28 PM
Herfried K. Wagner [MVP]
"Li Pang" <LiP***@discussions.microsoft.com> schrieb:
> I read a text file line by line, and put the value into a arraylist. But
> some special characters lost after asignment. Is there any solution to
> avoid
> this?

If you are using 'System.IO.StreamReader' to read the text, you may want to
specify an appropriate encoding in the 'StreamReader''s constructor.
'System.Text.Encoding.Default' returns the system's default Windows-ANSI
codepage, which is used by many applications to encode text files.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>