summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFrans Pop <elendil@planet.nl>2005-11-21 18:10:38 +0000
committerFrans Pop <elendil@planet.nl>2005-11-21 18:10:38 +0000
commitdbdb07552d0b78032aa079a9b0a08295e69afe2a (patch)
tree63596c3ebc2d7dc0b077774e28d3d062ddf7e8fb /scripts
parent72aeb7747f486a8b301d6ad180f1d2445d359d0f (diff)
downloadinstallation-guide-dbdb07552d0b78032aa079a9b0a08295e69afe2a.zip
Make sure po files are utf-8 encoded before running po2xml
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/create_po2
-rwxr-xr-xscripts/create_xml12
2 files changed, 12 insertions, 2 deletions
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