mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Update encodings from v3.14.3
This commit is contained in:
1 parent
a49ab1911c
commit
951a97e32d
2 files changed
+8
-17
No files matched your search
Vendored
-17
@@ -156,23 +156,6 @@ def search_function(encoding):
|
||||
codecs.register(search_function)
|
||||
|
||||
if sys.platform == 'win32':
|
||||
# bpo-671666, bpo-46668: If Python does not implement a codec for current
|
||||
# Windows ANSI code page, use the "mbcs" codec instead:
|
||||
# WideCharToMultiByte() and MultiByteToWideChar() functions with CP_ACP.
|
||||
# Python does not support custom code pages.
|
||||
def _alias_mbcs(encoding):
|
||||
try:
|
||||
import _winapi
|
||||
ansi_code_page = "cp%s" % _winapi.GetACP()
|
||||
if encoding == ansi_code_page:
|
||||
import encodings.mbcs
|
||||
return encodings.mbcs.getregentry()
|
||||
except ImportError:
|
||||
# Imports may fail while we are shutting down
|
||||
pass
|
||||
|
||||
codecs.register(_alias_mbcs)
|
||||
|
||||
from ._win_cp_codecs import create_win32_code_page_codec
|
||||
|
||||
def win32_code_page_search_function(encoding):
|
||||
|
||||
Vendored
+8
@@ -204,6 +204,11 @@ aliases = {
|
||||
'csibm869' : 'cp869',
|
||||
'ibm869' : 'cp869',
|
||||
|
||||
# cp874 codec
|
||||
'874' : 'cp874',
|
||||
'ms874' : 'cp874',
|
||||
'windows_874' : 'cp874',
|
||||
|
||||
# cp932 codec
|
||||
'932' : 'cp932',
|
||||
'ms932' : 'cp932',
|
||||
@@ -241,6 +246,7 @@ aliases = {
|
||||
'ks_c_5601_1987' : 'euc_kr',
|
||||
'ksx1001' : 'euc_kr',
|
||||
'ks_x_1001' : 'euc_kr',
|
||||
'cseuckr' : 'euc_kr',
|
||||
|
||||
# gb18030 codec
|
||||
'gb18030_2000' : 'gb18030',
|
||||
@@ -399,6 +405,8 @@ aliases = {
|
||||
'iso_8859_8' : 'iso8859_8',
|
||||
'iso_8859_8_1988' : 'iso8859_8',
|
||||
'iso_ir_138' : 'iso8859_8',
|
||||
'iso_8859_8_i' : 'iso8859_8',
|
||||
'iso_8859_8_e' : 'iso8859_8',
|
||||
|
||||
# iso8859_9 codec
|
||||
'csisolatin5' : 'iso8859_9',
|
||||
|
||||
Reference in new issue
Block a user