Permalink
Browse files

rhbz748727 specify Content-Type charset to UTF-8 when writing out po …

…files
  • Loading branch information...
1 parent b9eff21 commit a4b37148e44afb488d8a8db18ab32d179379d6a1 @jamesni jamesni committed Feb 1, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 zanataclient/publicanutil.py
@@ -298,7 +298,9 @@ def save_to_pofile(self, path, translations, pot):
po.header = extensions.get('comment')
for item in extensions.get('entries'):
po.metadata[item['key']]=item['value']
-
+ #specify Content-Type charset to UTF-8
+ po.metadata['Content-Type'] = "text/plain; charset=UTF-8"
+
for textflow in textflows:
if textflow.get('extensions'):
poentry = polib.POEntry(occurrences=None)

1 comment on commit a4b3714

@seanf
Member
seanf commented on a4b3714 Feb 2, 2012

It's best to apply a regex replace on "charset=", which preserves the previous mime type (eg application/x-publican), rather than completely overwriting the original Content-Type. Unless of course there is no Content-Type, in which case text/plain is okay.

Please sign in to comment.