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

localeでLC_ALLをいじったら文字化けするようになってしまったときの対処

Posted at

以下コマンドでlocaleの設定を確認

$ locale -a
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="ja_JP.UJIS"
LC_NUMERIC="ja_JP.UJIS"
LC_TIME="ja_JP.UJIS"
LC_COLLATE="ja_JP.UJIS"
LC_MONETARY="ja_JP.UJIS"
LC_MESSAGES="ja_JP.UJIS"
LC_PAPER="ja_JP.UJIS"
LC_NAME="ja_JP.UJIS"
LC_ADDRESS="ja_JP.UJIS"
LC_TELEPHONE="ja_JP.UJIS"
LC_MEASUREMENT="ja_JP.UJIS"
LC_IDENTIFICATION="ja_JP.UJIS"
LC_ALL=ja_JP.UJIS

上の例だと、LC_ALLがja_JP.UJISになっており、これはLANG変数よりも優先される。
これがターミナル側の文字エンコーディング解釈と一致してない。

以下コマンドで治る。

export LC_ALL=C.UTF-8

補足

aptコマンドの出力はlocaleの影響を受ける。

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