convmv

user-pic
Vote 0 Votes

將目前目錄以下所有檔案及目錄從 big5 編碼改成 UTF-8 編碼, 超方便
convmv -fbig5 -tutf-8 -r --notest .

轉檔案的部份, 準備一個 script big5utf8.sh, 放在 /usr/local/bin
#!/bin/sh
iconv -c -s -f big5 -t utf-8 "$FILE" > "$FILE.tmp"
sed -e s/big5/UTF-8/ -e s/Big5/UTF-8/ -e s/BIG5/UTF-8/ "$FILE.tmp" > "$FILE"
rm "$FILE.tmp"

將此目錄以下 .html .htm 檔案改編碼及 charset 為 UTF-8
find . -name "*.htm*" -exec big5utf8.sh {} \;

Leave a comment

About this Entry

This page contains a single entry by Pank published on September 28, 2011 11:17 AM.

iTaiwan Free WiFi was the previous entry in this blog.

解決Yahoo!奇摩輸入法出現指令碼錯誤 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives