Skip to content

Instantly share code, notes, and snippets.

@terashim
Created October 7, 2019 04:04
Show Gist options
  • Select an option

  • Save terashim/c80af451a554b5dcbdf87cf6b730477d to your computer and use it in GitHub Desktop.

Select an option

Save terashim/c80af451a554b5dcbdf87cf6b730477d to your computer and use it in GitHub Desktop.
nkfコマンドの基本的な使い方
# インストール
brew install nkf
# 元ファイル作成
echo 'こんにちは' > test.txt
# 文字コードを調べる
nkf -g test.txt
# Shift JISに変換
nkf -s test.txt > test-sjis.txt
# UTF-8に変換
nkf -u test-sjis.txt > test-utf8.txt
# Shift JIS & CRLF に変換
nkf -s -Lw test.txt > test-sjis-crlf.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment