Change Tomcat's Charset.defaultCharset in windows

前端 未结 4 536
梦毁少年i
梦毁少年i 2020-12-03 03:06

I\'m using tomcat 6.0.32 in windows 7. Inside a very simple servlet, inside the init method, I\'m printing:

System.out.println(Charset.defaultCharset());
         


        
4条回答
  •  执笔经年
    2020-12-03 03:47

    Try setting the (Windows) environment variable JAVA_TOOL_OPTIONS to -Dfile.encoding=UTF-8 and start the Tomcat Server.

    Will get more idea from this link: Setting the default Java character encoding

提交回复
热议问题