J
Juho Vuori
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
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