LoginSignup
0
0

More than 5 years have passed since last update.

UTF-8文字列のバイト列を調べる

Posted at

UTF-8形式の文字列のバイト列を調べたい場合に使うコマンドのメモ。

16進数で出力

16進数で出力したい場合にはodコマンドで16進ダンプします。

$ echo -n 'あいうえお' | od -tx1 -An

10進数で出力

オプションを-tu1にすれば10進数になります。

$ echo -n 'あいうえお' | od -tu1 -An

2進数で出力

2進数で出力したい場合にはxxdコマンドで2進ダンプします。

$ echo -n 'あいうえお' | xxd -g -1 -b
0
0
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
0
0