.NET garbage

response.addHeader("Content-Disposition","attachment; filename="+filename)

The Chinese garbage problem
two solutions
1. If the web.config utf-8
directly Server.UrlEncode (filename) can
2. Otherwise, they will use the second method
filename = HttpUtility.UrlEncode (Encoding.UTF8.GetBytes ( filename));
as if the code must be UTF8, regardless of your
resp.ContentEncoding = System.Text.Encoding.GetEncoding ( "gb2312") ;
this statement is written inside what encoding.

Published 241 original articles · won praise 14 · views 50000 +

Guess you like

Origin blog.csdn.net/qq_29150765/article/details/85159898