Skip to content

Instantly share code, notes, and snippets.

@yoh2
Created June 21, 2018 13:47
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 yoh2/de225b8bd95d7f43c735b694254f858e to your computer and use it in GitHub Desktop.
Save yoh2/de225b8bd95d7f43c735b694254f858e to your computer and use it in GitHub Desktop.
片っ端から iconv 変換を試してみる
#!/bin/bash
readonly infile=hoge.txt
iconv -l | while read enc; do
if iconv -f $enc -t utf-8 < $infile > tmp.txt 2>/dev/null; then
cat tmp.txt
echo --
echo $enc
echo ==========================
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment