#!/bin/sh # # Convert a text file from Codepage 850 to UTF-8 # [ $# -eq 0 ] && { echo "usage: $(basename $0) file ..." >&2; exit 1; } for f in "$@"; do tmpfile=$(mktemp ~/.ms2u.XXXXXX) || exit 1 iconv -f cp850 -t utf-8 "$f" >$tmpfile mv -f $tmpfile "$f" && chmod go+r "$f" done .