polib has more names than UTF-8 for utf8

In case of id.po it returns utf-8.
This commit is contained in:
Georg Baum 2016-04-24 16:37:54 +02:00
parent 1b4728b5e2
commit bc53fc53f8

View File

@ -130,7 +130,7 @@ def mergepo_minimaldiff(target, source, options):
target_enc = polib.detect_encoding(target)
# for utf8 files we can use our self written parser to minimize diffs,
# otherwise we need to use polib
if target_enc != 'UTF-8':
if not target_enc in ['UTF-8', 'utf-8', 'utf_8']:
raise
po1 = open(target, 'rb')
oldlines = read(po1)