From 818d0d1f5f0df89434552fd25c39617b20be93a4 Mon Sep 17 00:00:00 2001 From: Kaustav Das Modak Date: Wed, 23 Jan 2013 18:39:15 +0530 Subject: [PATCH] Use codecs module for unicode import from json file --- pyavrophonetic/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyavrophonetic/config.py b/pyavrophonetic/config.py index 706e28a..8edf161 100755 --- a/pyavrophonetic/config.py +++ b/pyavrophonetic/config.py @@ -27,6 +27,7 @@ # Imports import os import simplejson as json +import codecs # Constants @@ -36,7 +37,7 @@ AVRO_DICT_FILE = os.path.abspath(os.path.join(BASE_PATH, "resources/avrodict.json")) # -- Loads json data from avrodict.json -AVRO_DICT = json.load(open(AVRO_DICT_FILE)) +AVRO_DICT = json.load(codecs.open(AVRO_DICT_FILE, encoding='utf-8')) # -- Shortcut to vowels AVRO_VOWELS = set(AVRO_DICT['data']['vowel']) # -- Shortcut to consonants