Commit d61fd6a4 authored by Michal Čihař's avatar Michal Čihař

Automatically adjust Content-Type header in po files

Generated files usually have ASCII charset, but we store UTF-8 strings
in that.

Fixes #392
parent 553d043d
......@@ -426,6 +426,14 @@ class FileFormat(object):
return
kwargs['x_generator'] = 'Weblate %s' % weblate.VERSION
# Adjust Content-Type header if needed
header = self.store.parseheader()
if (not 'Content-Type' in header
or 'charset=CHARSET' in header['Content-Type']
or 'charset=ASCII' in header['Content-Type']):
kwargs['Content_Type'] = 'text/plain; charset=UTF-8'
self.store.updateheader(**kwargs)
def save(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment