mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-19 16:12:04 +02:00
18.0 vanilla
This commit is contained in:
parent
d72e748793
commit
0a7ae8db93
337 changed files with 399651 additions and 232598 deletions
26
odoo-bringout-oca-ocb-base/odoo/_monkeypatches/codecs.py
Normal file
26
odoo-bringout-oca-ocb-base/odoo/_monkeypatches/codecs.py
Normal 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'
|
||||
Loading…
Add table
Add a link
Reference in a new issue