2010-04-23 62 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。

如果您向我們展示代碼示例,可能會更容易進行調試。

相關問題