From: <bc...@wo...> - 2002-01-11 10:49:03
|
>> Then unicode() would be a no-op. It would just return the argument >> without doing anything. [Paul Prescod] >Is that a problem? If the user specifies an encoding then you could >decode. If they don't, I would suggest to just do a no-op. Under what >circumstances would the current exception be more helpful? The single argument unicode() call will use the default encoding. That can be changed to something other than "ascii" and then a no-op makes less sense: [d:\]p22 -S Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.setdefaultencoding("cp1253") >>> unicode("\x80") u'\u20ac' >>> regards, finn |