LoginSignup
0
0

More than 3 years have passed since last update.

【Linux】文字コード関連

Last updated at Posted at 2021-03-23

サーバ上でファイルを読んだ時に文字化けしてしまう場合、nkfに渡してやると日本語化してくれたりする。

(例)メールファイルのsubjectが文字化けして読めない場合、以下のようにする。

# cat メールファイル名 | grep -i subject | nkf

文字コードの確認

# file -i memo
memo: text/plain; charset=iso-8859-1
# nkf --guess memo
EUC-JP

memoファイルの文字コードをEUC-JPからUTF-8に変換してmemo_newとして保存

# iconv -f EUC-JP -t UTF-8 memo -o memo_new

# nkf --guess memo_new
UTF-8
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