From c10f06ddaecd5d2c0262242c48056b39cf75878e Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 27 Dec 2013 11:03:06 +0000 Subject: [PATCH] write joined locale as utf-8 --- pandora/app/config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandora/app/config.py b/pandora/app/config.py index 7094264f..ab00b83e 100644 --- a/pandora/app/config.py +++ b/pandora/app/config.py @@ -7,6 +7,7 @@ import sys import shutil import time import thread +import codecs from glob import glob from django.conf import settings @@ -256,8 +257,8 @@ def update_static(): with open(site_locale) as fdl: print ' adding', site_locale locale.update(json.load(fdl)) - with open(locale_file, 'w') as fd: - json.dump(locale, fd) + with codecs.open(locale_file, "w", "utf-8") as fd: + json.dump(locale, fd, ensure_ascii=False) os.system('gzip -9 -c "%s" > "%s.gz"' % (locale_file, locale_file))