Setting the default Java character encoding

后端 未结 17 1713
终归单人心
终归单人心 2020-11-21 06:09

How do I properly set the default character encoding used by the JVM (1.5.x) programmatically?

I have read that -Dfile.encoding=whatever used to be the

17条回答
  •  粉色の甜心
    2020-11-21 06:57

    Try this :

        new OutputStreamWriter( new FileOutputStream("Your_file_fullpath" ),Charset.forName("UTF8"))
    

提交回复
热议问题