From 6b7575849764fb33ccbc514baea1de70f6294a6a Mon Sep 17 00:00:00 2001 From: sergey aleksandrov Date: Fri, 8 Jun 2012 09:16:21 +0400 Subject: [PATCH] python3k to_unicode fix in locale.load_translations --- tornado/locale.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tornado/locale.py b/tornado/locale.py index 415b3440..1e361d46 100644 --- a/tornado/locale.py +++ b/tornado/locale.py @@ -47,6 +47,8 @@ import logging import os import re +from tornado import escape + _default_locale = "en_US" _translations = {} _supported_locales = frozenset([_default_locale]) @@ -124,7 +126,7 @@ def load_translations(directory): for i, row in enumerate(csv.reader(f)): if not row or len(row) < 2: continue - row = [c.decode("utf-8").strip() for c in row] + row = [escape.to_unicode(c).strip() for c in row] english, translation = row[:2] if len(row) > 2: plural = row[2] or "unknown"