mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Fix encoding issues with Alias containing non-ascii characters.
This commit is contained in:
parent
b360871378
commit
cefd91d4f1
@ -68,6 +68,8 @@ class AliasTestCase(ChannelPluginTestCase):
|
||||
def testAliasHelp(self):
|
||||
self.assertNotError('alias add slashdot foo')
|
||||
self.assertRegexp('help slashdot', "Alias for .*foo")
|
||||
self.assertNotError('alias add nonascii echo éé')
|
||||
self.assertRegexp('help nonascii', "Alias for .*echo éé")
|
||||
|
||||
def testRemove(self):
|
||||
self.assertNotError('alias add foo echo bar')
|
||||
|
@ -444,10 +444,12 @@ def format(s, *args, **kwargs):
|
||||
char = match.group(1)
|
||||
if char == 's':
|
||||
token = args.pop()
|
||||
if isinstance(token, unicode) or isinstance(token, str):
|
||||
if isinstance(token, str):
|
||||
return token
|
||||
elif sys.version_info[0] < 3 and isinstance(token, unicode):
|
||||
return token.encode('utf8')
|
||||
else:
|
||||
return unicode(token)
|
||||
return str(token)
|
||||
elif char == 'i':
|
||||
# XXX Improve me!
|
||||
return str(args.pop())
|
||||
|
Loading…
Reference in New Issue
Block a user