Varkhan..
9
我认为iconv是你的答案......
表格人iconv:
NAME
iconv - Convert encoding of given files from one encoding to another
SYNOPSIS
iconv -f encoding -t encoding inputfile
DESCRIPTION
The iconv program converts the encoding of characters in inputfile from one coded
character set to another. The result is written to standard output unless otherwise
specified by the --output option.
.....
所以你可以做一个
find $my_base_dir -name "*.php" -o -name "*.html" -exec sh -c "( \
iconv -t ISO88592 -f UTF8 {} -o {}.iconv ; \
mv {}.iconv {} ; \
)" \;
这将递归地找到适当命名的文件并重新编码它们(临时文件是必需的,因为iconv将在开始工作之前截断输出).