LoginSignup
121

More than 5 years have passed since last update.

Macでファイルの文字コードを調べる

Last updated at Posted at 2014-10-12

Macでfileコマンドをつかってファイルの文字コードを調べました。

fileコマンドで文字コードを調べる

fileコマンドに--mimeオプションをつけます。

fileコマンドで文字コードを確認
file --mime hoge.php
hoge.php: text/x-php; charset=utf-8

hoge.phpの文字コードを、表示しています。

前はnkfコマンドというのを使っていたのですが、fileコマンドで見られるのですね。fileコマンドのほうが便利だと思いました(☝ ՞ਊ ՞)

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
121