LoginSignup
39
37

More than 5 years have passed since last update.

IntelliJでプロパティのnative2ascii変換をEclipse互換にする

Last updated at Posted at 2013-08-11

IntelliJとEclipseのnative2ascii変換の違い

IntelliJではSettingsFile EncodingsTransparent native-to-ascii conversionをオンにするとJavaのプロパティファイルを透過的にnative2ascii変換してくれます。

元のプロパティファイル
log.error=エラーが起きました
IntelliJで変換
log.error=\u30A8\u30E9\u30FC\u304C\u8D77\u304D\u307E\u3057\u305F

ですが、Pleiades All in Oneに同梱されているProperties Editorを使うとIntelliJと違い小文字に変換されます。

Eclipseで変換
log.error=\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u307e\u3057\u305f

Eclipse使いが大半を占める中で一緒に開発していると、1文字変更しただけでも大文字小文字の違いでほとんどの値に差分が出てしまい、本当の差分が分かりにくくなります。

IntelliJでも小文字に変換する

IntelliJではnative2asciiの大文字小文字変換のようなニッチな設定も可能です。
ニッチ故に少し面倒ですがidea.propertiesに以下の値を追加します。

idea.properties
idea.native2ascii.lowercase=true

idea.propertiesの場所

WindowsとLinuxの場合はIntelliJをインストールしたフォルダの中にあります。

WindowsとLinuxの場合
<IntelliJ IDEA installation folder>/bin/idea.properties

Macでも同じようにIntelliJをインストールしたフォルダの中にありますが、
~/Library/Preferences/IntelliJIdea12/idea.propertiesにコピーするとこちらが優先されます。
コピー先のフォルダはバージョン毎に異なるので、バージョンアップしたときは忘れないように再度コピーして設定してください。

Macの場合
~/Library/Preferences/IntelliJIdea12/idea.properties
/Applications/IntelliJ IDEA 12.app/bin/idea.properties

これでEclipse使いが多い開発でも安心です。

IntelliJ IDEA 2018.3 Help

以上の内容はIntelliJのヘルプを参考にしました。

39
37
0

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
39
37