String: update docstrings of ord/chr, we're using unicode now

This commit is contained in:
Valentin Lorentz 2021-03-10 22:19:35 +01:00
parent 9bfa1458ef
commit c0527b6859
1 changed files with 3 additions and 3 deletions

View File

@ -53,7 +53,7 @@ class String(callbacks.Plugin):
def ord(self, irc, msg, args, letter): def ord(self, irc, msg, args, letter):
"""<letter> """<letter>
Returns the 8-bit value of <letter>. Returns the unicode codepoint of <letter>.
""" """
irc.reply(str(ord(letter))) irc.reply(str(ord(letter)))
ord = wrap(ord, ['letter']) ord = wrap(ord, ['letter'])
@ -62,12 +62,12 @@ class String(callbacks.Plugin):
def chr(self, irc, msg, args, i): def chr(self, irc, msg, args, i):
"""<number> """<number>
Returns the character associated with the 8-bit value <number> Returns the unicode character associated with codepoint <number>
""" """
try: try:
irc.reply(chr(i), stripCtcp=False) irc.reply(chr(i), stripCtcp=False)
except ValueError: except ValueError:
irc.error(_('That number doesn\'t map to an 8-bit character.')) irc.error(_('That number doesn\'t map to a unicode character.'))
chr = wrap(chr, ['int']) chr = wrap(chr, ['int'])
@internationalizeDocstring @internationalizeDocstring