This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients belopolsky, eric.araujo, ezio.melotti, jcea, lemburg, sdaoden, vstinner
Date 2011-02-24.21:17:27
SpamBayes Score 2.8051788e-06
Marked as misclassified No
Message-id <1298582262.66.0.172322280183.issue11303@psf.upfronthosting.co.za>
In-reply-to
Content
Probably not, but that part should be changed if possible, because is less efficient than the previous version that was allocating only 11 bytes.

The problem here is that the previous versions was only changing/removing chars, whereas this might add spaces too, so the string might get longer. E.g. 'utf8' -> 'utf 8'. The worst case is 'a1a1a1' -> 'a 1 a 1 a 1', and including the trailing \0, the result might end up being twice as long than the original encoding string. It can be fixed returning 0 as soon as the normalized string reaches a fixed threshold (something like 15 chars, depending on the longest normalized encoding name).
History
Date User Action Args
2011-02-24 21:17:42ezio.melottisetrecipients: + ezio.melotti, lemburg, jcea, belopolsky, vstinner, eric.araujo, sdaoden
2011-02-24 21:17:42ezio.melottisetmessageid: <1298582262.66.0.172322280183.issue11303@psf.upfronthosting.co.za>
2011-02-24 21:17:27ezio.melottilinkissue11303 messages
2011-02-24 21:17:27ezio.melotticreate