StreamReader编码ansi问题 [英] StreamReader Encoding ansi problem

查看:368
本文介绍了StreamReader编码ansi问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在VB.NET中使用StreamReader时出了问题。

我尝试读取包含扩展字符的txt文件和theese

从正在读取的行中删除。


我已经阅读了很多关于ANSI编码的文章这样
http://support.microsoft.com/default ... b; en-us; 889835


但是System.Text.Encoding.Default不起作用!!


任何想法??

谢谢,LucaJonny!

Hi,
I''ve got a problem using StreamReader in VB.NET.
I try to read a txt file that contains extended characters and theese
are removed from the line that is being read.

I''ve read a lot of articles about ANSI encoding like this
http://support.microsoft.com/default...b;en-us;889835

but System.Text.Encoding.Default don''t work!!

Any ideas??
Thanks, LucaJonny!

推荐答案

LucaJonny schrieb:
LucaJonny schrieb:

我在VB.NET中使用StreamReader时遇到了问题。
我尝试读取一个包含扩展字符的txt文件,然后将这些文件删除。正在阅读。

我已经阅读了很多关于这种ANSI编码的文章
http://support.microsoft.com/default...b;en-us; 889835

但System.Text.Encoding.Default不起作用!!

任何想法?
谢谢,LucaJonny!
Hi,
I''ve got a problem using StreamReader in VB.NET.
I try to read a txt file that contains extended characters and
theese are removed from the line that is being read.

I''ve read a lot of articles about ANSI encoding like this
http://support.microsoft.com/default...b;en-us;889835

but System.Text.Encoding.Default don''t work!!

Any ideas??
Thanks, LucaJonny!



你确定该文件是ANSI编码的文本文件吗?

Armin


Are you sure the file is an ANSI encoded text file?
Armin


尝试设置编码StreamReader的参数为默认。我是
的意思,而不是默认。如果你把它留空,你得到的是

实际单词Default。如果您使用系统默认编码(对于

示例,西欧(Windows))可以处理扩展字符,

您的问题就解决了。

至少,这解决了它。


干杯,

zdrakec

Try setting the Encoding parameter of your StreamReader to "Default". I
mean, not the "default" which you get if you leave it blank, but the
actual word "Default". If you system default encoding (mine is, for
example, Western European (Windows)) can handle extended characters,
your problem is solved.
At least, that solved it for me.

Cheers,
zdrakec


啊,对不起,我看到你正在使用默认。我的意思是说,当然,

检查系统的默认设置,以确保它可以处理

扩展字符集。

对不起,


zdrakec

Ah, sorry, I see you are using "Default". I mean to say, of course,
check your system''s default setting to make sure it can handle the
extended character set.

Sorry,

zdrakec


这篇关于StreamReader编码ansi问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆