英文:
Spring batch file reading: JBOSS EAP 6.2 File encoding from UTF-8 to ISO-8859-1
问题
JBOSS EAP 6.2:
在 JBOSS 中,文件编码已经在 standalone.conf 中提到。
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8"
当前文件格式已从 "UTF-8" 更改为 "ISO-8859-1"。
我如何修改它?JBOSS 中的默认文件编码是什么?
Spring 批处理读取文件并写入数据库。
英文:
JBOSS EAP 6.2 :
In JBOSS file encoding has already mentioned in standalone.conf.
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8"
Currently file format is changed form "UTF-8" to "ISO-8859-1".
How I can modify it? What is the default file encoding in JBOSS?
Spring batch read the file and write into database.
答案1
得分: 0
最后我找到了答案。standalone.conf 需要像下面这样修改。我以为这可能是一个答案,但在互联网上搜索时没有提到过。
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=ISO-8859-1"
这将在Java JVM中设置文件编码。因此,文件将由Java相应地进行编码。
https://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html
英文:
Finally I found the answer.standalone.conf need to be modified like below. I thought this might be an answer, But it was not mentioned anywhere when I searched in the internet.
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=ISO-8859-1"
This will set in Java JVM file encoding. So , File will be encoded by java accordingly
https://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论