Spring批处理文件读取:JBOSS EAP 6.2 文件编码从UTF-8到ISO-8859-1。

huangapple go评论97阅读模式
英文:

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

huangapple
  • 本文由 发表于 2020年8月3日 22:07:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/63230977.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定