Open1

Shift JISからUTF-8に変換する方法

yonishiyonishi

ディレクトリの中の*.cと*.hを変換

#!/bin/bash
for ext in c h; do
    for file in /path/to/your/directory/*.$ext; do
        echo $file
        if [ -f "$file" ]; then
            iconv -f SHIFT-JIS -t UTF-8 "$file" > "${file}.tmp" &&
            mv "${file}.tmp" "$file"
        fi
    done
done