Message2034
FYI:
To recode an 8-bit string using the default encoding into
a string using a different encoding, you only have to call the
.encode() method on the string object, e.g.
>>> "abc".encode('utf-16')
'\377\376a\000b\000c\000'
>>> "abc".encode('utf-8')
'abc'
But with ASCII as default encoding there's nothing much recode
into UTF-8 anyway ;-) Still, the method makes writing polymorphic
code which produces 8-bit strings as output a tad easier.
Perhaps JPython's strings should have a .encode() method too...
|
|
Date |
User |
Action |
Args |
2007-08-23 13:51:43 | admin | link | issue216716 messages |
2007-08-23 13:51:43 | admin | create | |
|