Re: Problem with Unicode char in Python 3.3.0

2013-01-08 Thread Terry Reedy
On 1/7/2013 8:12 AM, Terry Reedy wrote: On 1/7/2013 7:57 AM, Franck Ditter wrote: <<< print('\U0001d11e') Traceback (most recent call last): File "", line 1, in print('\U0001d11e') UnicodeEncodeError: 'UCS-2' codec can't encode character '\U0001d11e' in position 0: Non-BMP character no

Re: Problem with Unicode char in Python 3.3.0

2013-01-07 Thread Terry Reedy
On 1/7/2013 7:57 AM, Franck Ditter wrote: <<< print('\U0001d11e') Traceback (most recent call last): File "", line 1, in print('\U0001d11e') UnicodeEncodeError: 'UCS-2' codec can't encode character '\U0001d11e' in position 0: Non-BMP character not supported in Tk The message comes fro

Re: Problem with Unicode char in Python 3.3.0

2013-01-07 Thread Chris Angelico
On Mon, Jan 7, 2013 at 11:57 PM, Franck Ditter wrote: > <<< print('\U0001d11e') > Traceback (most recent call last): > File "", line 1, in > print('\U0001d11e') > UnicodeEncodeError: 'UCS-2' codec can't encode character '\U0001d11e' > in position 0: Non-BMP character not supported in Tk Th

Re: Problem with Unicode char in Python 3.3.0

2013-01-07 Thread Franck Ditter
In article , marduk wrote: > On Sun, Jan 6, 2013, at 11:43 AM, Franck Ditter wrote: > > Hi ! > > I work on MacOS-X Lion and IDLE/Python 3.3.0 > > I can't get the treble key (U1D11E) ! > > > > >>> "\U1D11E" > > SyntaxError: (unicode error) 'unicodeescape' codec can't > > decode bytes in positio

Re: Problem with Unicode char in Python 3.3.0

2013-01-06 Thread marduk
On Sun, Jan 6, 2013, at 11:43 AM, Franck Ditter wrote: > Hi ! > I work on MacOS-X Lion and IDLE/Python 3.3.0 > I can't get the treble key (U1D11E) ! > > >>> "\U1D11E" > SyntaxError: (unicode error) 'unicodeescape' codec can't > decode bytes in position 0-6: end of string in escape sequence >

Re: Problem with Unicode char in Python 3.3.0

2013-01-06 Thread Peter Otten
Franck Ditter wrote: > I work on MacOS-X Lion and IDLE/Python 3.3.0 > I can't get the treble key (U1D11E) ! > "\U1D11E" > SyntaxError: (unicode error) 'unicodeescape' codec can't > decode bytes in position 0-6: end of string in escape sequence > > How can I display musical keys ? Try >>> "

Re: problem with unicode

2008-04-25 Thread hdante
On Apr 25, 8:15 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > I don't know what to do. I just want to concatenate two string where > apparently one is a binary string, the other one is a unicode string > and I always seem to get this error. Please explain better what you want to do with

Re: problem with unicode

2008-04-25 Thread John Machin
On Apr 26, 6:42 am, Bjoern Schliessmann wrote: > John Machin wrote: > > On Apr 25, 10:01 pm, Bjoern Schliessmann >> >>> media="x???[?" > >> >>> print repr(media.decode("utf-8")) > > >> u'x\u30ef\u30e6\u30ed[\u30e8' > > (dang, KNode doesn't autodetect encodings ...) > > > But that_unicode_string.e

Re: problem with unicode

2008-04-25 Thread Bjoern Schliessmann
John Machin wrote: > On Apr 25, 10:01 pm, Bjoern Schliessmann > >>> media="x???[?" >> >>> print repr(media.decode("utf-8")) >> >> u'x\u30ef\u30e6\u30ed[\u30e8' (dang, KNode doesn't autodetect encodings ...) > But that_unicode_string.encode("utf-8") produces > 'x\xe3\x83\xaf\xe3\x83\xa6\xe3\x83\xa

Re: problem with unicode

2008-04-25 Thread Matt Nordhoff
[EMAIL PROTECTED] wrote: > Hi everybody, > > I'm using the win32 console and have the following short program > excerpt > > # media is a binary string (mysql escaped zipped file) > >>> print media > xワユロ[ヨ... > (works) > >>> print unicode(media) > UnicodeDecodeError: 'ascii' codec can't decode

Re: problem with unicode

2008-04-25 Thread John Machin
On Apr 25, 10:01 pm, Bjoern Schliessmann wrote: > [EMAIL PROTECTED] wrote: > > # media is a binary string (mysql escaped zipped file) > > print media > > x???[? ... > > (works) > > Which encoding, perhaps UTF-8 or ISO8859-1? > > print unicode(media) > > UnicodeDecodeError: 'ascii' codec

Re: problem with unicode

2008-04-25 Thread John Machin
On Apr 25, 9:15 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi everybody, > > I'm using the win32 console and have the following short program > excerpt > > # media is a binary string (mysql escaped zipped file) > > >> print media > > xワユロ[ヨ ... > (works) > > >> print unicode(media) > > Un

Re: problem with unicode

2008-04-25 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > # media is a binary string (mysql escaped zipped file) > print media > x???[?... > (works) Which encoding, perhaps UTF-8 or ISO8859-1? print unicode(media) > UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in > position 1: ordinal not in range(128