Posted By

rabc on 07/28/12


Tagged

file Bash encode


Versions (?)

Convert file encoding recursively


 / Published in: Bash
 

URL: http://stackoverflow.com/questions/1182037/osx-change-file-encoding-iconv-recursive

iconv -l to show all available encodes, replace xxx with you file ext

  1. #!/bin/bash
  2.  
  3. find /Path/To/Files -name \*.xxx -type f | \
  4. (while read file; do
  5. iconv -f ISO-8859-1 -t UTF8 "$file" > "${file%.xxx}-utf8.xxx";
  6. done);

Report this snippet  

You need to login to post a comment.