1.1 --- a/lib/__builtins__/unicode.py Fri Feb 03 23:24:15 2017 +0100
1.2 +++ b/lib/__builtins__/unicode.py Fri Feb 03 23:25:00 2017 +0100
1.3 @@ -22,7 +22,7 @@
1.4 from __builtins__.str import basestring
1.5 from __builtins__.types import check_int
1.6 from posix.iconv import Converter
1.7 -from native import str_add, unicode_len, unicode_substr, \
1.8 +from native import str_add, unicode_len, unicode_ord, unicode_substr, \
1.9 isinstance as _isinstance
1.10
1.11 class utf8string(basestring):
1.12 @@ -112,6 +112,15 @@
1.13
1.14 return self.length
1.15
1.16 + def __ord__(self):
1.17 +
1.18 + "Return the value of the string, if only a single character."
1.19 +
1.20 + if self.__len__() == 1:
1.21 + return unicode_ord(self.__data__)
1.22 + else:
1.23 + raise ValueError, self
1.24 +
1.25 def encode(self, encoding=None):
1.26
1.27 """