[Zope] SUMMARY: strange unicode behaviour, unicode and ZCTextIndex

Dieter Maurer dieter at handshake.de
Sun Aug 10 20:46:38 EDT 2003


Toby Dickenson wrote at 2003-7-29 19:02 +0100:
 > On Friday 25 July 2003 19:29, Dieter Maurer wrote:
 > > ...
 > > Due to this default encoding, I save me from myriads of
 > > encoding errors and make interactive debugging feasible.
 > > Surely, you will understand, that I do not want to add
 > > an "encode('iso-8859-1')" to any value I output with "print"
 > > during interactive debugging.
 > 
 > Yes. I work in a mostly utf-8 world, and I originally wanted Python's unicode 
 > support to work somewhat like you are using it when first pioneering unicode 
 > in Zope. Guido convinced me otherwise:
 > 
 > http://aspn.activestate.com/ASPN/Mail/Message/i18n-sig/581409
 > (last paragraph in particular)

I read the explanation but I am not convinced.

While I agree fully that modules and packages destined to be used world wide
(such as Zope) should not make any assumptions about the default encoding
(I think, "[cp]DocumentTemplate" is buggy in this respect),
I feel strongly that Python should provide means to determine
the default encoding and do not fix it to an US standard.
I live in an "ISO-8859-15" world. Terminal, file system, servers
all use this encoding. Especially for interactive use of the Python
interpreter, it would be *really* nasty to have each (potential)
unicode string explicitely encoded in the *true* default encoding
of my environment.

Python currently restricts the use of "setdefaultencoding" to the
initialization time. I can live with this restriction as I would not
change it afterwards, anyway.


I faintly remember that Guido has reservations about locale support.
Nevertheless, it is a good step to let software adapt to the environment
it is used in. In my view, the default encoding is a similar device
which allows Python's Unicode support to adapt to the defaults employed
where Python programs are executed (rather than favour US usage only).


 > > I did not met any library that has had problems with this --
 > > neither Zope nor any other Python library I am using.
 > 
 > I think that is similar to how many people used those pentiums with the fdiv 
 > bug without noticing a problem. 

I know that there is no device completely faultless. Nevertheless,
I am using many of them.

I would not have been worried when I had
observed that I use a Pentium with the "fdiv" bug (as I do not
control power plants, airline or similar sensible systems
but just develop software. The worst thing which may happen it that
I spend some hours trying to find the reason for an apparently
unexplainable behaviour).


Dieter



More information about the Zope mailing list