1. 程式人生 > >-Dfile.encoding=UTF-8

-Dfile.encoding=UTF-8

·JDK1.3 沒有 XML 解析器,所有要自己配上 xercesImpl.jar 和 xml-apis.jar
·JDK 1.4.0 和 JDK 1.4.1 雖然具有了 XML 解析器,但是有些 Bug,所有還是得把 xercesImpl.jar 放到 Tomcat/common/endorsed 目錄中覆蓋掉預設的解析器
·JDK 1.4.2 及後來版本的 XML 解析器可以工作的很好

專案啟動時,報An invalid XML character (Unicode: 0xdcb5) was found in the element content of the document. 

在jvm上增加引數-Dfile.encoding=GBK,問題解決,但控制檯亂碼;

window——》preferrence——》general——》workspace,Text file encoding,default修改為gbk解決。