This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients
Date 2000-10-12.17:04:56
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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...

History
Date User Action Args
2007-08-23 13:51:43adminlinkissue216716 messages
2007-08-23 13:51:43admincreate