# $Id$ # iconv functions to convert charactersets miconvutf8() { local filelist="$@" local file local bindir [[ -z ${filelist} ]] && die "miconvutf8() no argument given!" case $1 in --enable-bindir|--bindir|-b) bindir="${BINDIR}/"; shift ;; *) bindir="" ;; esac for file in ${filelist} do iconv --from-code=ISO_8859-15 --to-code=UTF-8 "${bindir}${file}" > "${bindir}${file}.tmp" || die # set the same times touch -r "${bindir}${file}" "${bindir}${file}.tmp" || die mv "${bindir}${file}.tmp" "${bindir}${file}" || die if [[ -f ${file}.tmp ]] then rm "${bindir}${file}.tmp" || die fi done }