str() should convert ANY object to a string without EXCEPTIONS !

est electronixtar at
Sun Sep 28 10:35:11 CEST 2008

> Because that's how ASCII is defined.
> Because that's how ASCII is defined.  ASCII is a 7-bit code.

Then why can't python use another default encoding internally

> Python refuses to guess and tries the lowest common denominator -- ASCII -- instead.

That's the problem. ASCII is INCOMPLETE!

If Python choose another default encoding which handles range(256),
80% of python unicode encoding problems are gone.

It's not HARD to process unicode, it's just python & python community
refuse to correct it.

> stop dreaming of a magic solution

It's not 'magic' it's a BUG. Just print 0x7F to 0xFF to console,
what's wrong????

> Isn't that more or less the same as telling the OP to use unicode() instead of str()?

sockets could handle str() only. If you throw unicode objects to a
socket, it will automatically call str() and cause an error.

More information about the Python-list mailing list