-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encoding and alias issues #79732
Comments
There're some minor issues about encodings supported by Python.
|
"iso8859_1" is already an alias for "latin_1", though. https://github.com/python/cpython/blob/master/Lib/encodings/aliases.py#L432 |
Removing unused alias is OK. In encodings/ package, there are both of mac_centeuro.py and mac_latin2.py. |
I suppose that mac_centeuro can be removed since it is identical to mac_latin2, and there are already some aliases for mac_latin2. Then, mac_centeuro can be added as an alias for mac_latin2. I'm not sure about why latin_1 and iso8859_1 are both supported (they are identical). The doc says: "CPython implementation detail: Some common encodings can bypass the codecs lookup machinery to improve performance. These optimization opportunities are only recognized by CPython for a limited set of (case insensitive) aliases: utf-8, utf8, latin-1, latin1, iso-8859-1, iso8859-1, mbcs (Windows only), ascii, us-ascii, utf-16, utf16, utf-32, utf32, and the same using underscores instead of dashes. Using alternative aliases for these encodings may result in slower execution." Also not sure whether this would matter or not. |
@lemburg >>> from encodings import mac_latin2, mac_centeuro
>>> mac_latin2.decoding_table == mac_centeuro.decoding_table
True How do you think about removing mac_centeuro and adding an alias to mac_latin2? |
This codec was available as separate package at the time. Later the CJK codecs got added to the stdlib, but this codec was not. I guess it's fine to remove the alias.
|
Previously known as `mac_centeuro`; see also python/cpython#79732 (Closes: #3)
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: