Convert encoding of all matching files in directory and sub-directories

/ Published in: Bash
Save to your folder(s)

Useful to convert all matching files from one encoding to another.
Some examples:

Copy this code and paste it in your HTML
  1. find -name "PATTERN" -exec iconv --from-code=ENCODING_1 --to-code=ENCODING_2 '{}' -o '{}' \;
  2. find -name "*.php" -exec iconv --from-code=ISO8859-1 --to-code=UTF-8 '{}' -o '{}' \;
  3. find -regex ".*transl.*\.txt" -exec iconv --from-code=ISO8859-1 --to-code=UTF-8 '{}' -o '{}' \;

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.