Hopefully, this will fix the unicode issues we have with Amazon

This commit is contained in:
James Vega 2004-08-28 20:42:37 +00:00
parent eabb77abcf
commit 0349d11853
2 changed files with 5 additions and 1 deletions

View File

@ -120,7 +120,8 @@ class Amazon(callbacks.PrivmsgCommandAndRegexp):
else:
results['url'] = ' <%s>' % results['url']
s = reply % results
s.encode('utf-8')
s = u'%s' % s
s = s.encode('utf-8')
res.append(str(s))
except amazon.AmazonError, e:
self.log.warning(str(e))

View File

@ -40,6 +40,9 @@ if LICENSE_KEY != 'INITIAL_NON_LICENSE_KEY' and network:
PluginTestCase.setUp(self)
conf.supybot.plugins.amazon.licensekey.set(LICENSE_KEY)
def testUnicode(self):
self.assertNotError('artist husker du')
def testIsbn(self):
self.assertHelp('isbn')
self.assertRegexp('isbn 0738203793',