这里的其他答复似乎表明,制定这份名单很难,而且充满了陷阱。 然而,这样做可能没有必要,因为文件载有一份完整的标准编码清单,以支持并自第2.3号决议以来。
你们可以找到这些清单(迄今为止释放的每一种稳定的语言):
下面是每张有文件记载的Thury版本的清单。 请注意,如果你想要落后,而不是仅仅支持一种特定的甲型六氯环己烷,那么你就只能复制 最新<>的清单。 页: 1
Python 2.3 (59 encodings)
[ ascii ,
cp037 ,
cp424 ,
cp437 ,
cp500 ,
cp737 ,
cp775 ,
cp850 ,
cp852 ,
cp855 ,
cp856 ,
cp857 ,
cp860 ,
cp861 ,
cp862 ,
cp863 ,
cp864 ,
cp865 ,
cp869 ,
cp874 ,
cp875 ,
cp1006 ,
cp1026 ,
cp1140 ,
cp1250 ,
cp1251 ,
cp1252 ,
cp1253 ,
cp1254 ,
cp1255 ,
cp1256 ,
cp1257 ,
cp1258 ,
latin_1 ,
iso8859_2 ,
iso8859_3 ,
iso8859_4 ,
iso8859_5 ,
iso8859_6 ,
iso8859_7 ,
iso8859_8 ,
iso8859_9 ,
iso8859_10 ,
iso8859_13 ,
iso8859_14 ,
iso8859_15 ,
koi8_r ,
koi8_u ,
mac_cyrillic ,
mac_greek ,
mac_iceland ,
mac_latin2 ,
mac_roman ,
mac_turkish ,
utf_16 ,
utf_16_be ,
utf_16_le ,
utf_7 ,
utf_8 ]
Python 2.4 (85 encodings)
[ ascii ,
big5 ,
big5hkscs ,
cp037 ,
cp424 ,
cp437 ,
cp500 ,
cp737 ,
cp775 ,
cp850 ,
cp852 ,
cp855 ,
cp856 ,
cp857 ,
cp860 ,
cp861 ,
cp862 ,
cp863 ,
cp864 ,
cp865 ,
cp866 ,
cp869 ,
cp874 ,
cp875 ,
cp932 ,
cp949 ,
cp950 ,
cp1006 ,
cp1026 ,
cp1140 ,
cp1250 ,
cp1251 ,
cp1252 ,
cp1253 ,
cp1254 ,
cp1255 ,
cp1256 ,
cp1257 ,
cp1258 ,
euc_jp ,
euc_jis_2004 ,
euc_jisx0213 ,
euc_kr ,
gb2312 ,
gbk ,
gb18030 ,
hz ,
iso2022_jp ,
iso2022_jp_1 ,
iso2022_jp_2 ,
iso2022_jp_2004 ,
iso2022_jp_3 ,
iso2022_jp_ext ,
iso2022_kr ,
latin_1 ,
iso8859_2 ,
iso8859_3 ,
iso8859_4 ,
iso8859_5 ,
iso8859_6 ,
iso8859_7 ,
iso8859_8 ,
iso8859_9 ,
iso8859_10 ,
iso8859_13 ,
iso8859_14 ,
iso8859_15 ,
johab ,
koi8_r ,
koi8_u ,
mac_cyrillic ,
mac_greek ,
mac_iceland ,
mac_latin2 ,
mac_roman ,
mac_turkish ,
ptcp154 ,
shift_jis ,
shift_jis_2004 ,
shift_jisx0213 ,
utf_16 ,
utf_16_be ,
utf_16_le ,
utf_7 ,
utf_8 ]
Python 2.5 (86 encodings)
[ ascii ,
big5 ,
big5hkscs ,
cp037 ,
cp424 ,
cp437 ,
cp500 ,
cp737 ,
cp775 ,
cp850 ,
cp852 ,
cp855 ,
cp856 ,
cp857 ,
cp860 ,
cp861 ,
cp862 ,
cp863 ,
cp864 ,
cp865 ,
cp866 ,
cp869 ,
cp874 ,
cp875 ,
cp932 ,
cp949 ,
cp950 ,
cp1006 ,
cp1026 ,
cp1140 ,
cp1250 ,
cp1251 ,
cp1252 ,
cp1253 ,
cp1254 ,
cp1255 ,
cp1256 ,
cp1257 ,
cp1258 ,
euc_jp ,
euc_jis_2004 ,
euc_jisx0213 ,
euc_kr ,
gb2312 ,
gbk ,
gb18030 ,
hz ,
iso2022_jp ,
iso2022_jp_1 ,
iso2022_jp_2 ,
iso2022_jp_2004 ,
iso2022_jp_3 ,
iso2022_jp_ext ,
iso2022_kr ,
latin_1 ,
iso8859_2 ,
iso8859_3 ,
iso8859_4 ,
iso8859_5 ,
iso8859_6 ,
iso8859_7 ,
iso8859_8 ,
iso8859_9 ,
iso8859_10 ,
iso8859_13 ,
iso8859_14 ,
iso8859_15 ,
johab ,
koi8_r ,
koi8_u ,
mac_cyrillic ,
mac_greek ,
mac_iceland ,
mac_latin2 ,
mac_roman ,
mac_turkish ,
ptcp154 ,
shift_jis ,
shift_jis_2004 ,
shift_jisx0213 ,
utf_16 ,
utf_16_be ,
utf_16_le ,
utf_7 ,
utf_8 ,
utf_8_sig ]
Python 2.6 (90 encodings)
[ ascii ,
big5 ,
big5hkscs ,
cp037 ,
cp424 ,
cp437 ,
cp500 ,
cp737 ,
cp775 ,
cp850 ,
cp852 ,
cp855 ,
cp856 ,
cp857 ,
cp860 ,
cp861 ,
cp862 ,
cp863 ,
cp864 ,
cp865 ,
cp866 ,
cp869 ,
cp874 ,
cp875 ,
cp932 ,
cp949 ,
cp950 ,
cp1006 ,
cp1026 ,
cp1140 ,
cp1250 ,
cp1251 ,
cp1252 ,
cp1253 ,
cp1254 ,
cp1255 ,
cp1256 ,
cp1257 ,
cp1258 ,
euc_jp ,
euc_jis_2004 ,
euc_jisx0213 ,
euc_kr ,
gb2312 ,
gbk ,
gb18030 ,
hz ,
iso2022_jp ,
iso2022_jp_1 ,
iso2022_jp_2 ,
iso2022_jp_2004 ,
iso2022_jp_3 ,
iso2022_jp_ext ,
iso2022_kr ,
latin_1 ,
iso8859_2 ,
iso8859_3 ,
iso8859_4 ,
iso8859_5 ,
iso8859_6 ,
iso8859_7 ,
iso8859_8 ,
iso8859_9 ,
iso8859_10 ,
iso8859_13 ,
iso8859_14 ,
iso8859_15 ,
iso8859_16 ,
johab ,
koi8_r ,
koi8_u ,
mac_cyrillic ,
mac_greek ,
mac_iceland ,
mac_latin2 ,
mac_roman ,
mac_turkish ,
ptcp154 ,
shift_jis ,
shift_jis_2004 ,
shift_jisx0213 ,
utf_32 ,
utf_32_be ,
utf_32_le ,
utf_16 ,
utf_16_be ,
utf_16_le ,
utf_7 ,
utf_8 ,
utf_8_sig ]
Python 2.7 (93 encodings)
[ ascii ,
big5 ,
big5hkscs ,
cp037 ,
cp424 ,
cp437 ,
cp500 ,
cp720 ,
cp737 ,
cp775 ,
cp850 ,
cp852 ,
cp855 ,
cp856 ,
cp857 ,
cp858 ,
cp860 ,
cp861 ,
cp862 ,
cp863 ,
cp864 ,
cp865 ,
cp866 ,
cp869 ,
cp874 ,
cp875 ,
cp932 ,
cp949 ,
cp950 ,
cp1006 ,
cp1026 ,
cp1140 ,
cp1250 ,
cp1251 ,
cp1252 ,
cp1253 ,
cp1254 ,
cp1255 ,
cp1256 ,
cp1257 ,
cp1258 ,
euc_jp ,
euc_jis_2004 ,
euc_jisx0213 ,
euc_kr ,
gb2312 ,
gbk ,
gb18030 ,
hz ,
iso2022_jp ,
iso2022_jp_1 ,
iso2022_jp_2 ,
iso2022_jp_2004 ,
iso2022_jp_3 ,
iso2022_jp_ext ,
iso2022_kr ,
latin_1 ,
iso8859_2 ,
iso8859_3 ,
iso8859_4 ,
iso8859_5 ,
iso8859_6 ,
iso8859_7 ,
iso8859_8 ,
iso8859_9 ,
iso8859_10 ,
iso8859_11 ,
iso8859_13 ,
iso8859_14 ,
iso8859_15 ,
iso8859_16 ,
johab ,
koi8_r ,
koi8_u ,
mac_cyrillic ,
mac_greek ,
mac_iceland ,
mac_latin2 ,
mac_roman ,
mac_turkish ,
ptcp154 ,
shift_jis ,
shift_jis_2004 ,
shift_jisx0213 ,
utf_32 ,
utf_32_be ,
utf_32_le ,
utf_16 ,
utf_16_be ,
utf_16_le ,
utf_7 ,
utf_8 ,
utf_8_sig ]
Python 3.0 (89 encodings)
[ ascii ,
big5 ,
big5hkscs ,
cp037 ,
cp424 ,
cp437 ,
cp500 ,
cp737 ,
cp775 ,
cp850 ,
cp852 ,
cp855 ,
cp856 ,
cp857 ,
cp860 ,
cp861 ,
cp862 ,
cp863 ,
cp864 ,
cp865 ,
cp866 ,
cp869 ,
cp874 ,
cp875 ,
cp932 ,
cp949 ,
cp950 ,
cp1006 ,
cp1026 ,
cp1140 ,
cp1250 ,
cp1251 ,
cp1252 ,
cp1253 ,
cp1254 ,
cp1255 ,
cp1256 ,
cp1257 ,
cp1258 ,
euc_jp ,
euc_jis_2004 ,
euc_jisx0213 ,
euc_kr ,
gb2312 ,
gbk ,
gb18030 ,
hz ,
iso2022_jp ,
iso2022_jp_1 ,
iso2022_jp_2 ,
iso2022_jp_2004 ,
iso2022_jp_3 ,
iso2022_jp_ext ,
iso2022_kr ,
latin_1 ,
iso8859_2 ,
iso8859_3 ,
iso8859_4 ,
iso8859_5 ,
iso8859_6 ,
iso8859_7 ,
iso8859_8 ,
iso8859_9 ,
iso8859_10 ,
iso8859_13 ,
iso8859_14 ,
iso8859_15 ,
johab ,
koi8_r ,
koi8_u ,
mac_cyrillic ,
mac_greek ,
mac_iceland ,
mac_latin2 ,
mac_roman ,
mac_turkish ,
ptcp154 ,
shift_jis ,
shift_jis_2004 ,
shift_jisx0213 ,
utf_32 ,
utf_32_be ,
utf_32_le ,
utf_16 ,
utf_16_be ,
utf_16_le ,
utf_7 ,
utf_8 ,
utf_8_sig ]
Python 3.1 (90 encodings)
[ ascii ,
big5 ,
big5hkscs ,
cp037 ,
cp424 ,
cp437 ,
cp500 ,
cp737 ,
cp775 ,
cp850 ,
cp852 ,
cp855 ,
cp856 ,
cp857 ,
cp860 ,
cp861 ,
cp862 ,
cp863 ,
cp864 ,
cp865 ,
cp866 ,
cp869 ,
cp874 ,
cp875 ,
cp932 ,
cp949 ,
cp950 ,
cp1006 ,
cp1026 ,
cp1140 ,
cp1250 ,
cp1251 ,
cp1252 ,
cp1253 ,
cp1254 ,
cp1255 ,
cp1256 ,
cp1257 ,
cp1258 ,
euc_jp ,
euc_jis_2004 ,
euc_jisx0213 ,
euc_kr ,
gb2312 ,
gbk ,
gb18030 ,
hz ,
iso2022_jp ,
iso2022_jp_1 ,
iso2022_jp_2 ,
iso2022_jp_2004 ,
iso2022_jp_3 ,
iso2022_jp_ext ,
iso2022_kr ,
latin_1 ,
iso8859_2 ,
iso8859_3 ,
iso8859_4 ,
iso8859_5 ,
iso8859_6 ,
iso8859_7 ,
iso8859_8 ,
iso8859_9 ,
iso8859_10 ,
iso8859_13 ,
iso8859_14 ,
iso8859_15 ,
iso8859_16 ,
johab ,
koi8_r ,
koi8_u ,
mac_cyrillic ,
mac_greek ,
mac_iceland ,
mac_latin2 ,
mac_roman ,
mac_turkish ,
ptcp154 ,
shift_jis ,
shift_jis_2004 ,
shift_jisx0213 ,
utf_32 ,
utf_32_be ,
utf_32_le ,
utf_16 ,
utf_16_be ,
utf_16_le ,
utf_7 ,
utf_8 ,
utf_8_sig ]
Python 3.2 (92 encodings)
[ ascii ,
big5 ,
big5hkscs ,
cp037 ,
cp424 ,
cp437 ,
cp500 ,
cp720 ,
cp737 ,
cp775 ,
cp850 ,
cp852 ,
cp855 ,
cp856 ,
cp857 ,
cp858 ,
cp860 ,
cp861 ,
cp862 ,
cp863 ,
cp864 ,
cp865 ,
cp866 ,
cp869 ,
cp874 ,
cp875 ,
cp932 ,
cp949 ,
cp950 ,
cp1006 ,
cp1026 ,
cp1140 ,
cp1250 ,
cp1251 ,
cp1252 ,
cp1253 ,
cp1254 ,
cp1255 ,
cp1256 ,
cp1257 ,
cp1258 ,
euc_jp ,
euc_jis_2004 ,
euc_jisx0213 ,
euc_kr ,
gb2312 ,
gbk ,
gb18030 ,
hz ,
iso2022_jp ,
iso2022_jp_1 ,
iso2022_jp_2 ,
iso2022_jp_2004 ,
iso2022_jp_3 ,
iso2022_jp_ext ,
iso2022_kr ,
latin_1 ,
iso8859_2 ,
iso8859_3 ,
iso8859_4 ,
iso8859_5 ,
iso8859_6 ,
iso8859_7 ,
iso8859_8 ,
iso8859_9 ,
iso8859_10 ,
iso8859_13 ,
iso8859_14 ,
iso8859_15 ,
iso8859_16 ,
johab ,
koi8_r ,
koi8_u ,
mac_cyrillic ,
mac_greek ,
mac_iceland ,
mac_latin2 ,
mac_roman ,
mac_turkish ,
ptcp154 ,
shift_jis ,
shift_jis_2004 ,
shift_jisx0213 ,
utf_32 ,
utf_32_be ,
utf_32_le ,
utf_16 ,
utf_16_be ,
utf_16_le ,
utf_7 ,
utf_8 ,
utf_8_sig ]
Python 3.3 (93 encodings)
[ ascii ,
big5 ,
big5hkscs ,
cp037 ,
cp424 ,
cp437 ,
cp500 ,
cp720 ,
cp737 ,
cp775 ,
cp850 ,
cp852 ,
cp855 ,
cp856 ,
cp857 ,
cp858 ,
cp860 ,
cp861 ,
cp862 ,
cp863 ,
cp864 ,
cp865 ,
cp866 ,
cp869 ,
cp874 ,
cp875 ,
cp932 ,
cp949 ,
cp950 ,
cp1006 ,
cp1026 ,
cp1140 ,
cp1250 ,
cp1251 ,
cp1252 ,
cp1253 ,
cp1254 ,
cp1255 ,
cp1256 ,
cp1257 ,
cp1258 ,
cp65001 ,
euc_jp ,
euc_jis_2004 ,
euc_jisx0213 ,
euc_kr ,
gb2312 ,
gbk ,
gb18030 ,
hz ,
iso2022_jp ,
iso2022_jp_1 ,
iso2022_jp_2 ,
iso2022_jp_2004 ,
iso2022_jp_3 ,
iso2022_jp_ext ,
iso2022_kr ,
latin_1 ,
iso8859_2 ,
iso8859_3 ,
iso8859_4 ,
iso8859_5 ,
iso8859_6 ,
iso8859_7 ,
iso8859_8 ,
iso8859_9 ,
iso8859_10 ,
iso8859_13 ,
iso8859_14 ,
iso8859_15 ,
iso8859_16 ,
johab ,
koi8_r ,
koi8_u ,
mac_cyrillic ,
mac_greek ,
mac_iceland ,
mac_latin2 ,
mac_roman ,
mac_turkish ,
ptcp154 ,
shift_jis ,
shift_jis_2004 ,
shift_jisx0213 ,
utf_32 ,
utf_32_be ,
utf_32_le ,
utf_16 ,
utf_16_be ,
utf_16_le ,
utf_7 ,
utf_8 ,
utf_8_sig ]
Python 3.4 (96 encodings)
[ ascii ,
big5 ,
big5hkscs ,
cp037 ,
cp273 ,
cp424 ,
cp437 ,
cp500 ,
cp720 ,
cp737 ,
cp775 ,
cp850 ,
cp852 ,
cp855 ,
cp856 ,
cp857 ,
cp858 ,
cp860 ,
cp861 ,
cp862 ,
cp863 ,
cp864 ,
cp865 ,
cp866 ,
cp869 ,
cp874 ,
cp875 ,
cp932 ,
cp949 ,
cp950 ,
cp1006 ,
cp1026 ,
cp1125 ,
cp1140 ,
cp1250 ,
cp1251 ,
cp1252 ,
cp1253 ,
cp1254 ,
cp1255 ,
cp1256 ,
cp1257 ,
cp1258 ,
cp65001 ,
euc_jp ,
euc_jis_2004 ,
euc_jisx0213 ,
euc_kr ,
gb2312 ,
gbk ,
gb18030 ,
hz ,
iso2022_jp ,
iso2022_jp_1 ,
iso2022_jp_2 ,
iso2022_jp_2004 ,
iso2022_jp_3 ,
iso2022_jp_ext ,
iso2022_kr ,
latin_1 ,
iso8859_2 ,
iso8859_3 ,
iso8859_4 ,
iso8859_5 ,
iso8859_6 ,
iso8859_7 ,
iso8859_8 ,
iso8859_9 ,
iso8859_10 ,
iso8859_11 ,
iso8859_13 ,
iso8859_14 ,
iso8859_15 ,
iso8859_16 ,
johab ,
koi8_r ,
koi8_u ,
mac_cyrillic ,
mac_greek ,
mac_iceland ,
mac_latin2 ,
mac_roman ,
mac_turkish ,
ptcp154 ,
shift_jis ,
shift_jis_2004 ,
shift_jisx0213 ,
utf_32 ,
utf_32_be ,
utf_32_le ,
utf_16 ,
utf_16_be ,
utf_16_le ,
utf_7 ,
utf_8 ,
utf_8_sig ]
Python 3.5 (98 encodings)
[ ascii ,
big5 ,
big5hkscs ,
cp037 ,
cp273 ,
cp424 ,
cp437 ,
cp500 ,
cp720 ,
cp737 ,
cp775 ,
cp850 ,
cp852 ,
cp855 ,
cp856 ,
cp857 ,
cp858 ,
cp860 ,
cp861 ,
cp862 ,
cp863 ,
cp864 ,
cp865 ,
cp866 ,
cp869 ,
cp874 ,
cp875 ,
cp932 ,
cp949 ,
cp950 ,
cp1006 ,
cp1026 ,
cp1125 ,
cp1140 ,
cp1250 ,
cp1251 ,
cp1252 ,
cp1253 ,
cp1254 ,
cp1255 ,
cp1256 ,
cp1257 ,
cp1258 ,
cp65001 ,
euc_jp ,
euc_jis_2004 ,
euc_jisx0213 ,
euc_kr ,
gb2312 ,
gbk ,
gb18030 ,
hz ,
iso2022_jp ,
iso2022_jp_1 ,
iso2022_jp_2 ,
iso2022_jp_2004 ,
iso2022_jp_3 ,
iso2022_jp_ext ,
iso2022_kr ,
latin_1 ,
iso8859_2 ,
iso8859_3 ,
iso8859_4 ,
iso8859_5 ,
iso8859_6 ,
iso8859_7 ,
iso8859_8 ,
iso8859_9 ,
iso8859_10 ,
iso8859_11 ,
iso8859_13 ,
iso8859_14 ,
iso8859_15 ,
iso8859_16 ,
johab ,
koi8_r ,
koi8_t ,
koi8_u ,
kz1048 ,
mac_cyrillic ,
mac_greek ,
mac_iceland ,
mac_latin2 ,
mac_roman ,
mac_turkish ,
ptcp154 ,
shift_jis ,
shift_jis_2004 ,
shift_jisx0213 ,
utf_32 ,
utf_32_be ,
utf_32_le ,
utf_16 ,
utf_16_be ,
utf_16_le ,
utf_7 ,
utf_8 ,
utf_8_sig ]
Python 3.6 (98 encodings)
Same as previous edition.
Python 3.7 (98 encodings)
Same as previous edition.
Python 3.8 (97 encodings)
[ ascii ,
big5 ,
big5hkscs ,
cp037 ,
cp273 ,
cp424 ,
cp437 ,
cp500 ,
cp720 ,
cp737 ,
cp775 ,
cp850 ,
cp852 ,
cp855 ,
cp856 ,
cp857 ,
cp858 ,
cp860 ,
cp861 ,
cp862 ,
cp863 ,
cp864 ,
cp865 ,
cp866 ,
cp869 ,
cp874 ,
cp875 ,
cp932 ,
cp949 ,
cp950 ,
cp1006 ,
cp1026 ,
cp1125 ,
cp1140 ,
cp1250 ,
cp1251 ,
cp1252 ,
cp1253 ,
cp1254 ,
cp1255 ,
cp1256 ,
cp1257 ,
cp1258 ,
euc_jp ,
euc_jis_2004 ,
euc_jisx0213 ,
euc_kr ,
gb2312 ,
gbk ,
gb18030 ,
hz ,
iso2022_jp ,
iso2022_jp_1 ,
iso2022_jp_2 ,
iso2022_jp_2004 ,
iso2022_jp_3 ,
iso2022_jp_ext ,
iso2022_kr ,
latin_1 ,
iso8859_2 ,
iso8859_3 ,
iso8859_4 ,
iso8859_5 ,
iso8859_6 ,
iso8859_7 ,
iso8859_8 ,
iso8859_9 ,
iso8859_10 ,
iso8859_11 ,
iso8859_13 ,
iso8859_14 ,
iso8859_15 ,
iso8859_16 ,
johab ,
koi8_r ,
koi8_t ,
koi8_u ,
kz1048 ,
mac_cyrillic ,
mac_greek ,
mac_iceland ,
mac_latin2 ,
mac_roman ,
mac_turkish ,
ptcp154 ,
shift_jis ,
shift_jis_2004 ,
shift_jisx0213 ,
utf_32 ,
utf_32_be ,
utf_32_le ,
utf_16 ,
utf_16_be ,
utf_16_le ,
utf_7 ,
utf_8 ,
utf_8_sig ]
Python 3.9 (97 encodings)
Same as previous edition.
Python 3.10 (97 encodings)
Same as previous edition.
Python 3.11 (97 encodings)
Same as previous edition.
如果它们与任何使用案件有关,则指出,该说明还列出了一些Python-specific encodings,其中很多似乎主要供作淫媒内部使用,或以某种方式供使用,如<编码>未定义的编码>编码编码编码编码编码,编码编码编码编码编码在你试图使用时总是带有例外。 如果像这里的问答者一样,你再次试图指出你在现实世界中看到的某些案文使用了哪些编码,你可能想完全忽视这些内容。 名单如下:
["idna",
"mbcs",
"oem",
"palmos",
"punycode",
"raw_unicode_escape",
"rot_13",
"undefined",
"unicode_escape",
"unicode_internal",
"base64_codec",
"bz2_codec",
"hex_codec",
"quopri_codec",
"uu_codec",
"zlib_codec"]
一些较老的甲型六氯环己烷版本有string_einski
,其中特别编码是,由于从语言上删除,我没有列入上述清单。
最后,如果你要更新上述表格,以备更新的“灰色”版。
import re
import requests
import lxml.html
import pprint
previous = None
for version, url in [
( 2.3 , https://docs.python.org/2.3/lib/node130.html ),
( 2.4 , https://docs.python.org/2.4/lib/standard-encodings.html ),
( 2.5 , https://docs.python.org/2.5/lib/standard-encodings.html ),
( 2.6 , https://docs.python.org/2.6/library/codecs.html#standard-encodings ),
( 2.7 , https://docs.python.org/2.7/library/codecs.html#standard-encodings ),
( 3.0 , https://docs.python.org/3.0/library/codecs.html#standard-encodings ),
( 3.1 , https://docs.python.org/3.1/library/codecs.html#standard-encodings ),
( 3.2 , https://docs.python.org/3.2/library/codecs.html#standard-encodings ),
( 3.3 , https://docs.python.org/3.3/library/codecs.html#standard-encodings ),
( 3.4 , https://docs.python.org/3.4/library/codecs.html#standard-encodings ),
( 3.5 , https://docs.python.org/3.5/library/codecs.html#standard-encodings ),
( 3.6 , https://docs.python.org/3.6/library/codecs.html#standard-encodings ),
( 3.7 , https://docs.python.org/3.7/library/codecs.html#standard-encodings ),
( 3.8 , https://docs.python.org/3.8/library/codecs.html#standard-encodings ),
( 3.9 , https://docs.python.org/3.9/library/codecs.html#standard-encodings ),
( 3.10 , https://docs.python.org/3.10/library/codecs.html#standard-encodings ),
( 3.11 , https://docs.python.org/3.11/library/codecs.html#standard-encodings ),
]:
html = requests.get(url).text
# Work-around for weird HTML markup in recent versions of Python documentation:
html = re.sub( <[/]?p> , , html)
doc = lxml.html.fromstring(html)
standard_encodings_table = doc.xpath(
//table[preceding::h2[.//text()[contains(., "Standard Encodings")]]][//th/text()="Codec"]
)[0]
codecs = standard_encodings_table.xpath( .//td[1]/text() )
print("## Python %s (%i encodings)
" % (version, len(codecs)))
if codecs == previous:
print( _Same as previous version._
)
else:
print( ```python
+ pprint.pformat(codecs) +
```
)
previous = codecs