Thomas Heller wrote:
How can I do the equivalent of u"some string" in terms of unicode("some string", encoding) For example the copyright symbol "©" (repr("©") gives "\xa9"). Now I want to convert this string to unicode. u"©" works fine, unicode(variable) gives an ASCII decoding error.
u"something" maps to unicode("something", "latin-1"). This is because Unicode literals in Python are interpreted as being Latin-1. See the source code encoding PEP (0263) for details on what could be done to make this user-configurable. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/