0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Java の file.encoding の不思議

0
Last updated at Posted at 2015-01-05

osx で Region を Japan にして Language を English に設定すると、

$ mvn help:system > en_US.systemproperties
(設定変更してリブート)
$ mvn help:system > en_JP.systemproperties
$ diff en_JP.systemproperties en_US.systemproperties
< file.encoding=UTF-8
---
> file.encoding=US-ASCII
(snip)
< LC_CTYPE=
---
> LC_CTYPE=en_US.UTF-8
(snip)
> LANG=en_US.UTF-8

となって大変ハマる(年末年始でマシンの電源切ったりリブートしたりすると)。

確認したバージョンは以下。

$ java -fullversion
java full version "1.8.0_25-b17"

LC_CTYPE あるいは LANG のいずれかが設定されていれば、file.encoding=UTF-8 になるようだった。ふむ。

0
1
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?