Py 3.3, unicode / upper()

wxjmfauth at gmail.com wxjmfauth at gmail.com
Thu Dec 27 14:36:48 EST 2012


Le jeudi 27 décembre 2012 20:00:37 UTC+1, Serhiy Storchaka a écrit :
> On 19.12.12 17:40, Chris Angelico wrote:
> 
> > Interestingly, IDLE on my Windows box can't handle the bolded
> 
> > characters very well...
> 
> >
> 
> >>>> s="\U0001d407\U0001d41e\U0001d425\U0001d425\U0001d428, \U0001d430\U0001d428\U0001d42b\U0001d425\U0001d41d!"
> 
> >>>> print(s)
> 
> > Traceback (most recent call last):
> 
> >    File "<pyshell#2>", line 1, in <module>
> 
> >      print(s)
> 
> > UnicodeEncodeError: 'UCS-2' codec can't encode character '\U0001d407'
> 
> > in position 0: Non-BMP character not supported in Tk
> 
> >
> 
> > I think this is most likely a case of "yeah, Windows XP just sucks".
> 
> > But I have no reason or inclination to get myself a newer Windows to
> 
> > find out if it's any different.
> 
> 
> 
> No, this is a Tcl/Tk limitation (I don't know if this was fixed in 8.6).

-----


This is a strange error message. Remember: a coding scheme
covers a *set of characters*.
The guilty code point corresponds to a character which
is not part of the ucs-2 characters set!

jmf



More information about the Python-list mailing list