Tomcat中中文文件名不支持的解決方法
今天在Tomcat中做文件下載,發(fā)現(xiàn)如果文件名是中文名無(wú)法下載,而英文文件名的是沒有問(wèn)題的。
想想可能跟編碼有關(guān)系,在conf/server.xml配置文件發(fā)現(xiàn)在里面可以改其編碼方式。
<Connector port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true"
URIEncoding="UTF-8" useBodyEncodingForURI="true" />
</Connector>
把URIEncoding設(shè)為UTF-8就一切OK了。
想想可能跟編碼有關(guān)系,在conf/server.xml配置文件發(fā)現(xiàn)在里面可以改其編碼方式。
<Connector port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true"
URIEncoding="UTF-8" useBodyEncodingForURI="true" />
</Connector>
把URIEncoding設(shè)為UTF-8就一切OK了。
posted on 2005-05-19 13:03 月亮 閱讀(3012) 評(píng)論(3) 編輯 收藏