strange behaviour of str()
- From: Juho Vuori <juho.vuori@xxxxxxxxxxx>
- Date: Wed, 31 Aug 2005 13:20:21 +0300
Hello,
I'm wondering about the following behaviour of str() with strings containing non-ASCII characters:
str(u'foo') returns 'foo' as expected.
str('lää') returns 'lää' as expected.str(u'lää') raises UnicodeEncodeError
Is this behaviour sane? Possibly, but not documented at all. Somehow you'd expect str() to never fail. I'm hesitating about sending a bug report about a third party application, which fails because it is relaying on this.
Cheers, Juho Vuori .
- Follow-Ups:
- strange behaviour of str()
- From: Uwe Schmitt
- Re: strange behaviour of str()
- From: Fredrik Lundh
- strange behaviour of str()
- Prev by Date: .pth files in working directory
- Next by Date: Help with this error : Protocol wrong for this socket
- Previous by thread: .pth files in working directory
- Next by thread: Re: strange behaviour of str()
- Index(es):
Relevant Pages
|