把gbk目录文件批量转换为UTF-8

admin 提交于 星期一, 08/07/2017 - 15:56

此方法仅能转换一层目录:

for file in *; do iconv -c -f gb18030 -t utf-8 "$file">"../shijisjz/$file";done

 

下面方法可以转换整棵目录树,但Mac下用不了,因为Mac的iconv没有-o参数

find * -exec iconv -c -f GB18030 -t UTF-8 {} -o target_dir/{} \;

添加新评论

Restricted HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <img src>
  • 自动断行和分段。
  • Web page addresses and email addresses turn into links automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
请输入"Drupal8"