Shell: September 2011 Archives

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 {} \;

Recent Entries

About this Archive

This page is an archive of entries in the Shell category from September 2011.

Shell: August 2011 is the previous archive.

Shell: December 2011 is the next archive.

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

Monthly Archives