Skip to content

Commit da25f79

Browse files
author
Alexander Smishlajev
committed
ignore UTF-8 BOM in po file
1 parent 50cb5ef commit da25f79

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

roundup/msgfmt.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ def make(filename, outfile):
117117
print >> sys.stderr, msg
118118
sys.exit(1)
119119

120+
# remove UTF-8 Byte Order Mark, if any.
121+
# (UCS2 BOMs are not handled because messages in UCS2 cannot be handled)
122+
if lines[0].startswith('\xEF\xBB\xBF'):
123+
lines[0] = lines[0][3:]
124+
120125
section = None
121126
fuzzy = 0
122127

@@ -215,3 +220,5 @@ def main():
215220

216221
if __name__ == '__main__':
217222
main()
223+
224+
# vim: set et sts=4 sw=4 :

0 commit comments

Comments
 (0)