Convert files contents to UTF-8

#!/bin/bash # convert files (the contents) to UTF-8 # NOTE: not interactive and might lead to data-loss! DO A BACKUP BEFORE for file in `ls`; do iconv -f ISO-8859-9 -t UTF-8 -o ".utf8_$file" "$file" mv ".utf8_$file" "$file" done
Pretty simple script in bash to convert text contents of files in a directory to UTF-8.

Remember to do a back of your files before!

#bash #utf #script #bash #file

#cesarnog

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.