problem with code page
i need to read text hebrew file (ANSI)
- i try to save as Unicode
or UTF-8
开发者_开发知识库and i see only ?????
or _+_+_+#@#@#@
i try this:
FS = new FileStream(FilePath , FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
SW = new StreamReader(FS,Encoding.Default);
how to read with CodePage='1255'
? or how to solve this ?
thanks in advance
Pass new Encoding(1255)
. (Untested but according to documentation should work).
I think this line:
SW = new StreamReader(FS,Encoding.Default);
needs to be this:
SW = new StreamReader(FS,Encoding.ASCIIEncoding);
If that doesn't work your problem is almost certainly to do with the Encoding option you've set.
精彩评论