--- /dev/null
+#!/bin/bash
+
+
+set -e
+set -u
+
+CUR_DIR=$( dirname $0 )
+
+if [[ "$#" -ne "1" ]] ; then
+ cat >&2 <<EOF
+Usage:
+$0 ORIG_CHANGELOG
+
+EOF
+ exit 1
+fi
+
+ORIG="${1}"
+if [[ ! -f "${ORIG}" ]] ; then
+ echo "File '${ORIG}' does not exists." >&2
+ exit 1
+fi
+
+TEMP_FILE=$(mktemp tmp.changelog.XXXXXXXXXX.txt)
+
+cleanup() {
+ if [[ -f "${TEMP_FILE}" ]] ; then
+ rm -v "${TEMP_FILE}"
+ fi
+}
+
+trap "cleanup; echo 'Exception while running $0'; exit 5" INT TERM EXIT
+
+iconv -f windows-1252 -t utf-8 "${ORIG}" > "${TEMP_FILE}"
+dos2unix "${TEMP_FILE}"
+sed -i -e 's/[ ][ ]*$//' "${TEMP_FILE}"
+
+mv -vi "${TEMP_FILE}" "${CUR_DIR}/changelog.txt" </dev/null
+
+trap - INT TERM EXIT
+cleanup
+
+
+# vim: ts=4 et
+