2010-04-23 105 views
1

希伯来语角色,我想导出包含在我的ASP.net MVC应用程序我想导出包含在我的ASP.net MVC应用程序

我已经尝试了很多编码,但无法工作希伯来文字符CSV文件CSV文件。其实希伯来字符,并不显示它们。

任何人都有想法吗?

System.Text.UnicodeEncoding Enc = new UnicodeEncoding(); 

     HttpContext.Current.Response.AddHeader("Content-Length", Enc.GetByteCount(strExport).ToString()); 
     HttpContext.Current.Response.BinaryWrite(Enc.GetBytes(strExport)); 
     HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("windows-1255"); 
     //HttpContext.Current.Response.Charset = "iso-8859-8"; 
     HttpContext.Current.Response.ContentType = "text/csv"; 
     HttpContext.Current.Response.AddHeader("content-disposition", string.Format("attachment;inline; filename={0}.csv", fileName)); 

     HttpContext.Current.Response.End(); 

回答

0

曾几何时我们有多个客户,包括希伯来语,文本文件导入到MySQL,SQL服务器,等公司有标准化为UTF8作为编码的一切。那是几年前,所以ymmv。

如果您向我们展示代码示例,可能会更容易进行调试。

相关问题