4
0

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 1 year has passed since last update.

Git Bash で日本語が文字化けする。

Posted at

##Git Bashで日本語が文字化けする##

######出力したい結果

$ java Main
breakfast
アサゴハン
あさごはん
朝食

######文字化けした結果

$ java Main
breakfast
▒A▒T▒S▒n▒▒
▒▒▒▒▒▒▒͂▒
▒▒▒H

######私が解決した方法

1:GitBashを開き、右クリック

2:一番下の Options...を選択
image.png

3:Textから
Locale [ja_JP]
Character set [SJIS]
に変更
image.png

これでしっかり出力されるようになりました。


######追記

上記のことだけで解決できる可能性もありますが、その前に
[bash 文字化け]
で検索し、localeの設定をbashでしないと治らないかもしれません。(exportコマンド等)

4
0
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
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?