HTTP protocol Content-Disposition header in the Chinese file name garbled

HTTP protocol Content-Disposition header in the Chinese file name garbled

Cause: header only supports ASCII, so we transferred the file name must be ASCII, the file name when the Chinese, the Chinese must be converted into ASCII.

Workaround: Use url encoding of Chinese file name: java.net.URLEncoder.encode (fileName, "UTF8"); (in addition to IE, other browsers will not be garbled).

Browser few confusing points:
1, all browsers are userAgent with Mozilla, Mozilla can not determine what kind of browser.

Guess you like

Origin www.cnblogs.com/lcfeiyu/p/11610935.html