From dbdb07552d0b78032aa079a9b0a08295e69afe2a Mon Sep 17 00:00:00 2001 From: Frans Pop Date: Mon, 21 Nov 2005 18:10:38 +0000 Subject: Make sure po files are utf-8 encoded before running po2xml --- scripts/create_po | 2 +- scripts/create_xml | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/create_po b/scripts/create_po index bd919a663..ce0a240c1 100755 --- a/scripts/create_po +++ b/scripts/create_po @@ -101,5 +101,5 @@ echo "are untranslated but are not marked as such." echo "In that case, you can use the set_untranslated script to mark these strings as" echo "untranslated (enter 'set_untranslated --help' for usage)." -rm /tmp/tmp.po.$$ /tmp/$$.xml &>/dev/null +rm -f /tmp/tmp.po.$$ /tmp/$$.xml exit 0 diff --git a/scripts/create_xml b/scripts/create_xml index 2b12dc5a4..7ed3ca1eb 100755 --- a/scripts/create_xml +++ b/scripts/create_xml @@ -42,11 +42,20 @@ for ORIGXML in `find $SOURCEDIR -name "*.xml"` ; do if [ -f $PO ] ; then echo "- creating $BASENAME.xml" - po2xml $ORIGXML $PO > $XML + # Make sure po file is UTF8 encoded; po2xml does no conversion + msgconv -t utf-8 $PO >/tmp/tmp.po.$$ + RC=$? + if [ $RC -ne 0 ] ; then + RET=$RC + echo "Error: error $RC while executing msgconv" + continue + fi + po2xml $ORIGXML /tmp/tmp.po.$$ > $XML RC=$? if [ $RC -ne 0 ] ; then RET=$RC echo "Error: error $RC while executing po2xml" + continue fi else echo "Warning: no PO file found for '$BASENAME'; copying English original" @@ -54,4 +63,5 @@ for ORIGXML in `find $SOURCEDIR -name "*.xml"` ; do fi done +rm -f /tmp/tmp.po.$$ exit $RET -- cgit v1.2.3