我错过了什么或System.IO.FileStream不读取包含希伯来语的Unicode文本文件?
public TextReader CSVReader(Stream s, Encoding enc)
{
this.stream = s;
if (!s.CanRead)
{
throw new CSVReaderException("Could not read the given CSV stream!");
}
reader = (enc != null) ? new StreamReader(s, enc) : new StreamReader(s);
}
Run Code Online (Sandbox Code Playgroud)
谢谢乔纳森
FileStream只是一个字节流,它与语言/字符集无关.您需要一种编码来将字节转换为字符(包括希伯来语)并返回.
有几类来帮你,最重要的是System.Text.Encoding和System.IO.StreamReader和System.IO.StreamWriter.
| 归档时间: |
|
| 查看次数: |
2324 次 |
| 最近记录: |