[問題] asp.net 將頁面匯出成word出現亂碼

看板Web_Design作者 (知名不具)時間14年前 (2011/10/03 11:33), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
<% Response.Clear() Response.AddHeader("Content-Disposition", "Attachment;Filename=Word.doc") Response.Buffer = True Response.Charset = "utf-8" 'Response.ContentType = "application/vnd.word" 'Response.ContentType = "application/msword" 'Response.ContentType = "application/vnd.ms-word" %> <%="幹幹" %> <div style="border-style: solid; border-width: thin"> 我是中文字~~</div> 經由一個btn連去一個新的網頁,而這個網頁會直接把內容匯入word裡面 並且會出現一個存檔的視窗,目前為止都是很順利的進行著。 可是當我打開這個匯出的word檔(word.doc)後,內裡面中文字都變成亂碼(英數正常), 其中 Response.Charset = "utf-8" 部份也有用過big5或是整行註解掉 但是問題依然存在,希望會有好心的鄉民幫忙解疑。 thx !!!! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 111.240.165.79
文章代碼(AID): #1EYIqUwt (Web_Design)