
I just wanted to inform you of a change I plan for the standard encodings search function to enable better support for aliasing of encoding names. The current implementation caches the aliases returned from the codecs .getaliases() function in the encodings lookup cache rather than in the alias cache. As a consequence, the hyphen to underscore mapping is not applied to the aliases. A codec would have to return a list of all combinations of names with hyphens and underscores in order to emulate the standard lookup behaviour. I have a ptach which fixes this and also assures that aliases cannot be overwritten by codecs which register at some later point in time. This assures that we won't run into situations where a codec import suddenly overrides behaviour of previously active codecs. I would also like to propose the use of a new naming scheme for codecs which enables drop-in installation. As discussed on the i18n-sig list, people would like to install codecs without having the users to call a codec registration function or to touch site.py. The standard search function in the encodings package has a nice property (which I only noticed after the fact ;) which allows using Python package names in the encoding names, e.g. you can install a package 'japanese' and the access the codecs in that package using 'japanese.shiftjis' without having to bother registering a new codec search function for the package -- the encodings package search function will redirect the lookup to the 'japanese' package. Using package names in the encoding name has several advantages: * you know where the codec comes from * you can have mutliple codecs for the same encoding * drop-in installation without registration is possible * the need for a non-default encoding package is visible in the source code * you no longer need to drop new codecs into the Python standard lib Perhaps someone could add a note about this possibility to the codec docs ?! If noone objects, I'll apply the patch for the enhanced alias support later today. Thanks, -- Marc-Andre Lemburg ______________________________________________________________________ Company: http://www.egenix.com/ Consulting: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/

Perhaps someone could add a note about this possibility to the codec docs ?!
You can check it in yourself or mail it to Fred or submit it to SF... I don't expect anyone else will jump in and document this properly.
If noone objects, I'll apply the patch for the enhanced alias support later today.
Fine with me (but I don't use codecs -- where's the Dutch language support? :-). --Guido van Rossum (home page: http://www.python.org/~guido/)

Guido van Rossum wrote:
I'll submit a bug report so that this doesn't get lost in the archives. Don't have time for it myself... alas, noone really does seem to have time these days ;-)
OK. About the Dutch language support: this would make a nice Christmas fun-project... a new standard module which interfaces to babel.altavista.com (hmm, they don't list Dutch as a supported language yet, but maybe if we bug them enough... ;). -- Marc-Andre Lemburg ______________________________________________________________________ Company: http://www.egenix.com/ Consulting: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/

Perhaps someone could add a note about this possibility to the codec docs ?!
You can check it in yourself or mail it to Fred or submit it to SF... I don't expect anyone else will jump in and document this properly.
If noone objects, I'll apply the patch for the enhanced alias support later today.
Fine with me (but I don't use codecs -- where's the Dutch language support? :-). --Guido van Rossum (home page: http://www.python.org/~guido/)

Guido van Rossum wrote:
I'll submit a bug report so that this doesn't get lost in the archives. Don't have time for it myself... alas, noone really does seem to have time these days ;-)
OK. About the Dutch language support: this would make a nice Christmas fun-project... a new standard module which interfaces to babel.altavista.com (hmm, they don't list Dutch as a supported language yet, but maybe if we bug them enough... ;). -- Marc-Andre Lemburg ______________________________________________________________________ Company: http://www.egenix.com/ Consulting: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/
participants (2)
-
Guido van Rossum
-
M.-A. Lemburg