I wanted to convert a file written in UTF-8 character code to SHIFT-JIS, but I don't know how to do it. As a result of checking, it was said that the nkf command should be used, so I will summarize how to use it here
Abbreviation for Network Kanji Filter Command to convert character code and line feed code
$ nkf[option][File]
$ nkf[option]--overwrite file
option | Right align |
---|---|
-g | Output the character code of the file you want to convert |
-j | Output JIS code |
-s | Output shift JIS code |
-w16 | Output UTF code |
--overwrite | Convert and overwrite files |
$ nkf -w --overwrite hoge.html
nkf -s --overwrite hoge.html
It's easy, but I've summarized it. That's all for today.
Recommended Posts