Skip to content

Instantly share code, notes, and snippets.

@jonaswebdev
Created May 31, 2018 19:21
Show Gist options
  • Save jonaswebdev/bcd8784d1aabe4136807bdb03623051f to your computer and use it in GitHub Desktop.
Save jonaswebdev/bcd8784d1aabe4136807bdb03623051f to your computer and use it in GitHub Desktop.

Revisions

  1. jonaswebdev created this gist May 31, 2018.
    6 changes: 6 additions & 0 deletions convert-encoding-to-utf8.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    #!/bin/sh

    for file in $(find . -name "*.php" -type f)
    do
    iconv -f WINDOWS-1252 -t UTF-8 "$file" > "$file".utf8 && mv "$file".utf8 "$file" && echo "Success: $file"
    done