From add5e07d97db59d2146b5ced494b1cd1d3e73c3e Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 6 Jan 2013 19:54:04 +0100 Subject: [PATCH] Dict: Fix encoding. --- plugins/Dict/local/dictclient.py | 2 +- plugins/Dict/test.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/Dict/local/dictclient.py b/plugins/Dict/local/dictclient.py index 6bba74ed5..7cd9e19fe 100644 --- a/plugins/Dict/local/dictclient.py +++ b/plugins/Dict/local/dictclient.py @@ -72,7 +72,7 @@ class Connection: part only. Does not get any codes or anything! Returns a string.""" data = [] while 1: - line = self.rfile.readline().decode('ascii').strip() + line = self.rfile.readline().decode('utf8').strip() if line == '.': break data.append(line) diff --git a/plugins/Dict/test.py b/plugins/Dict/test.py index b853b21e8..7a8649709 100644 --- a/plugins/Dict/test.py +++ b/plugins/Dict/test.py @@ -1,3 +1,4 @@ +# -*- coding: utf8 -*- ### # Copyright (c) 2002-2004, Jeremiah Fincher # All rights reserved. @@ -36,6 +37,7 @@ class DictTestCase(PluginTestCase): self.assertNotError('dict slash') self.assertNotRegexp('dict web1913 slash', 'foldoc') self.assertError('dict ""') + self.assertRegexp('dict eng-fra school', 'école') def testDictionaries(self): self.assertNotError('dictionaries')