Search

12/25/2011

enca -- detect and convert encoding of text files

enca -- detect and convert encoding of text files

brew install enca

檢查文件編碼
[~/dev/google.code/project/subutil] $ enca foo.srt
Traditional Chinese Industrial Standard; Big5
CRLF line terminators

將文件編碼轉換成utf-8
[~/dev/google.code/project/subutil] $ enca -x UTF-8 < foo.srt > foo.ut8.srt
enca: Iconv conversion error on `/tmp/encaWvyWlGJf': Illegal byte sequence

不一定會成功, 比較可行的方式是 check 編碼後直接在 vlc player 把預設字幕編碼改掉

沒有留言: