18.0 vanilla

This commit is contained in:
Ernad Husremovic 2025-10-03 18:06:50 +02:00
parent d72e748793
commit 0a7ae8db93
337 changed files with 399651 additions and 232598 deletions

View file

@ -0,0 +1,26 @@
import codecs
import encodings.aliases
import re
import babel.core
def patch_codecs():
# ---------------------------------------------------------
# some charset are known by Python under a different name
# ---------------------------------------------------------
encodings.aliases.aliases['874'] = 'cp874'
encodings.aliases.aliases['windows_874'] = 'cp874'
# ---------------------------------------------------------
# alias hebrew iso-8859-8-i and iso-8859-8-e on iso-8859-8
# https://bugs.python.org/issue18624
# ---------------------------------------------------------
iso8859_8 = codecs.lookup('iso8859_8')
iso8859_8ie_re = re.compile(r'iso[-_]?8859[-_]8[-_]?[ei]', re.IGNORECASE)
codecs.register(lambda charset: iso8859_8 if iso8859_8ie_re.match(charset) else None)
# To remove when corrected in Babel
babel.core.LOCALE_ALIASES['nb'] = 'nb_NO'