From 6c294e03b067e712486b4b1928ccaf7f3553c886 Mon Sep 17 00:00:00 2001 From: Yi Yeon Jae Date: Wed, 24 Jul 2013 01:32:10 +0900 Subject: [PATCH] fixed UnicodeDecodeError in windows 7 (py3.3.2) --- korean/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/korean/__init__.py b/korean/__init__.py index f65adb5..62e5a31 100644 --- a/korean/__init__.py +++ b/korean/__init__.py @@ -10,6 +10,7 @@ """ from __future__ import absolute_import, unicode_literals import sys +import codecs from . import hangul, l10n, morphology from .morphology import (Morpheme, Noun, NumberWord, Loanword, Particle, @@ -35,7 +36,7 @@ def _load_data(): """Loads allomorphic particles and number words from :file:`data.json`.""" import json import os - with open(os.path.join(os.path.dirname(__file__), 'data.json')) as f: + with codecs.open(os.path.join(os.path.dirname(__file__), 'data.json'), encoding='utf-8') as f: data = json.load(f) # register allomorphic particles for forms in data['allomorphic_particles'].itervalues():