Skip to content

Instantly share code, notes, and snippets.

@maraigue
Created March 19, 2013 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maraigue/5194769 to your computer and use it in GitHub Desktop.
Save maraigue/5194769 to your computer and use it in GitHub Desktop.
Unicode(UTF-8でもUTF-16でも)のファイルを与えて、その中にあるEUC-JPで扱えない文字を検出するためのスクリプト
#!/bin/sh
nkf -e --no-best-fit-chars --fb-perl | grep -n '\\x{[0-9]\+}'
# --fb-perl は、変換において扱えない文字が存在した場合に、それをPerlの形式(\x{123})で出力する。
# これをgrepで検出している。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment