概要
Javaで「実行環境のエンコーディングに合わせてプログラムを実行する」の動作を確認してみました。
以下のページを参考にしました。
実装
以下のファイルを作成しました。
JSample4_1.java
class JSample4_1{
public static void main(String[] args){
System.out.println("いい天気ですね");
}
}
以下のコマンドを実行しました。
$ javac -J-Dfile.encoding=UTF-8 JSample4_1.java
$ java JSample4_1
いい天気ですね
まとめ
何かの役に立てばと。