diff roundup/msgfmt.py @ 3563:7000070fe600

ignore UTF-8 BOM in po file
author Alexander Smishlajev <a1s@users.sourceforge.net>
date Tue, 14 Feb 2006 05:21:54 +0000
parents a6bf25d38518
children 4498f5252f8b c643d693d91e
line wrap: on
line diff
--- a/roundup/msgfmt.py	Sun Feb 12 13:11:14 2006 +0000
+++ b/roundup/msgfmt.py	Tue Feb 14 05:21:54 2006 +0000
@@ -117,6 +117,11 @@
         print >> sys.stderr, msg
         sys.exit(1)
 
+    # remove UTF-8 Byte Order Mark, if any.
+    # (UCS2 BOMs are not handled because messages in UCS2 cannot be handled)
+    if lines[0].startswith('\xEF\xBB\xBF'):
+        lines[0] = lines[0][3:]
+
     section = None
     fuzzy = 0
 
@@ -215,3 +220,5 @@
 
 if __name__ == '__main__':
     main()
+
+# vim: set et sts=4 sw=4 :

Roundup Issue Tracker: http://roundup-tracker.org/