[Python-Dev] Minidom and Unicode

M.-A. Lemburg mal@lemburg.com
Mon, 03 Jul 2000 10:35:51 +0200

Paul Prescod wrote:
> "M.-A. Lemburg" wrote:
> >
> > ...
> >
> > I'd say +0, since the auto-converion can fail if the default
> > encoding doesn't have room for the tagName characters.
> >
> > Either way, I'd still prefer the DOM code to use an explicit
> > .encode() together with some lossless encoding, e.g.
> > unicode-escape.
> If we want to use a hard-coded lossless encoding, we should do so in
> repr. Rather than having us fix a dozen modules with problems like this,
> we should fix repr once and for all.

I think it's ok to auto-convert to the default encoding
as intermediate solution, but the applications wanting to
return Unicode as __repr__ or __str__ should really
use .encode() to make sure the output that is produces
matches their (or their user's) expectations.

Marc-Andre Lemburg
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/