2016-01-11 05:28:25 +01:00
|
|
|
# check the file's charactor code
|
|
|
|
nkf -g test.txt
|
2016-02-15 19:15:53 +01:00
|
|
|
|
2016-01-11 05:28:25 +01:00
|
|
|
# convert charactor code to UTF-8
|
|
|
|
nkf -w --overwrite test.txt
|
2016-02-15 19:15:53 +01:00
|
|
|
|
2016-01-11 05:28:25 +01:00
|
|
|
# convert charactor code to EUC-JP
|
|
|
|
nkf -e --overwrite test.txt
|
2016-02-15 19:15:53 +01:00
|
|
|
|
2016-01-11 05:28:25 +01:00
|
|
|
# convert charactor code to Shift-JIS
|
|
|
|
nkf -s --overwrite test.txt
|
2016-02-15 19:15:53 +01:00
|
|
|
|
2016-01-11 05:28:25 +01:00
|
|
|
# convert charactor code to ISO-2022-JP
|
|
|
|
nkf -j --overwrite test.txt
|
2016-02-15 19:15:53 +01:00
|
|
|
|
2016-01-11 05:28:25 +01:00
|
|
|
# convert newline to LF
|
|
|
|
nkf -Lu --overwrite test.txt
|
2016-02-15 19:15:53 +01:00
|
|
|
|
2016-01-11 05:28:25 +01:00
|
|
|
# convert newline to CRLF
|
|
|
|
nkf -Lw --overwrite test.txt
|
2016-02-15 19:15:53 +01:00
|
|
|
|
2016-01-11 05:28:25 +01:00
|
|
|
# convert newline to CR
|
|
|
|
nkf -Lm --overwrite test.txt
|
2016-02-15 19:15:53 +01:00
|
|
|
|
2016-01-11 05:28:25 +01:00
|
|
|
# MIME encode
|
|
|
|
echo テスト | nkf -WwMQ
|
2016-02-15 19:15:53 +01:00
|
|
|
|
2016-01-11 05:28:25 +01:00
|
|
|
# MIME decode
|
2016-02-15 19:15:53 +01:00
|
|
|
echo "=E3=83=86=E3=82=B9=E3=83=88" | nkf -WwmQ
|