#!/bin/sh
# converts a po file to utf-8 or removes it
# also it validates the file or removes it

if ./msg2utf8 "$1"
then
	if ./charset-tests "$1" >/dev/null 2>&1
	then
		echo "I: $1: is included in compendium"
	else
		echo "E: $1: file failed the tests, removed"
		rm -f "$1" "$1.utf"
	fi
else
	echo "E: $1: file removed from compilation"
	rm -f "$1" "$1.utf"
fi

