LoginSignup
5
4

More than 5 years have passed since last update.

nkfのmanページ文字化けをなんとかする

Posted at

nipponデバイス?

特にマニュアルを見る必要はなかったのだけれど、MacにHomebrewでインストールしたnkfのmanを見てみたらいきなりEOFとか表示されて、manを終了させるとなんかエラーが出てた。

$ man nkf
/usr/bin/groff: can't find `DESC' file
/usr/bin/groff:fatal error: invalid device `nippon'

なんだ?こりゃ。

groffをインストールする

調べてみたらOSXにHomebrewで入れたnkfでman nkfするとfatal error: invalid device `nippon'と言われるのをなんとかするにあるように、groffをインストールして vimで /etc/man.confを編集してやると、とりあえずmanページは表示されるようになりました。。。が!

Screen Shot 2016-04-02 at 12.24.44.png

化けとる。

nkfを使おう!

これはあれだな、nkfのお出ましだな。

$ cp -p /usr/local/Cellar/nkf/2.1.4/share/man/ja/man1/nkf.1 /usr/local/Cellar/nkf/2.1.4/share/man/ja/man1/nkf.1.org
$ cat /usr/local/Cellar/nkf/2.1.4/share/man/ja/man1/nkf.1.org | nkf -w8 > /usr/local/Cellar/nkf/2.1.4/share/man/ja/man1/nkf.1

ということでnkfが役に立った。…あれ?

5
4
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
5
4