/
snap
/
core24
/
1587
/
usr
/
lib
/
python3.12
/
encodings
/
/snap/core24/1587/usr/lib/python3.12/encodings
mkdir
upload
Name
Size
Mode
Actions
__pycache__/
-
0755
rm
aliases.py
15677
0644
edit
dl
rm
ascii.py
1248
0644
edit
dl
rm
base64_codec.py
1533
0644
edit
dl
rm
big5.py
1019
0644
edit
dl
rm
big5hkscs.py
1039
0644
edit
dl
rm
bz2_codec.py
2249
0644
edit
dl
rm
charmap.py
2084
0644
edit
dl
rm
cp037.py
13121
0644
edit
dl
rm
cp273.py
14132
0644
edit
dl
rm
cp424.py
12055
0644
edit
dl
rm
cp437.py
34564
0644
edit
dl
rm
cp500.py
13121
0644
edit
dl
rm
cp720.py
13686
0644
edit
dl
rm
cp737.py
34681
0644
edit
dl
rm
cp775.py
34476
0644
edit
dl
rm
cp850.py
34105
0644
edit
dl
rm
cp852.py
35002
0644
edit
dl
rm
cp855.py
33850
0644
edit
dl
rm
cp856.py
12423
0644
edit
dl
rm
cp857.py
33908
0644
edit
dl
rm
cp858.py
34015
0644
edit
dl
rm
cp860.py
34681
0644
edit
dl
rm
cp861.py
34633
0644
edit
dl
rm
cp862.py
33370
0644
edit
dl
rm
cp863.py
34252
0644
edit
dl
rm
cp864.py
33663
0644
edit
dl
rm
cp865.py
34618
0644
edit
dl
rm
cp866.py
34396
0644
edit
dl
rm
cp869.py
32965
0644
edit
dl
rm
cp874.py
12595
0644
edit
dl
rm
cp875.py
12854
0644
edit
dl
rm
cp932.py
1023
0644
edit
dl
rm
cp949.py
1023
0644
edit
dl
rm
cp950.py
1023
0644
edit
dl
rm
cp1006.py
13568
0644
edit
dl
rm
cp1026.py
13113
0644
edit
dl
rm
cp1125.py
34597
0644
edit
dl
rm
cp1140.py
13105
0644
edit
dl
rm
cp1250.py
13686
0644
edit
dl
rm
cp1251.py
13361
0644
edit
dl
rm
cp1252.py
13511
0644
edit
dl
rm
cp1253.py
13094
0644
edit
dl
rm
cp1254.py
13502
0644
edit
dl
rm
cp1255.py
12466
0644
edit
dl
rm
cp1256.py
12814
0644
edit
dl
rm
cp1257.py
13374
0644
edit
dl
rm
cp1258.py
13364
0644
edit
dl
rm
euc_jisx0213.py
1051
0644
edit
dl
rm
euc_jis_2004.py
1051
0644
edit
dl
rm
euc_jp.py
1027
0644
edit
dl
rm
euc_kr.py
1027
0644
edit
dl
rm
gb2312.py
1027
0644
edit
dl
rm
gb18030.py
1031
0644
edit
dl
rm
gbk.py
1015
0644
edit
dl
rm
hex_codec.py
1508
0644
edit
dl
rm
hp_roman8.py
13475
0644
edit
dl
rm
hz.py
1011
0644
edit
dl
rm
idna.py
9710
0644
edit
dl
rm
iso2022_jp.py
1053
0644
edit
dl
rm
iso2022_jp_1.py
1061
0644
edit
dl
rm
iso2022_jp_2.py
1061
0644
edit
dl
rm
iso2022_jp_3.py
1061
0644
edit
dl
rm
iso2022_jp_2004.py
1073
0644
edit
dl
rm
iso2022_jp_ext.py
1069
0644
edit
dl
rm
iso2022_kr.py
1053
0644
edit
dl
rm
iso8859_1.py
13176
0644
edit
dl
rm
iso8859_2.py
13404
0644
edit
dl
rm
iso8859_3.py
13089
0644
edit
dl
rm
iso8859_4.py
13376
0644
edit
dl
rm
iso8859_5.py
13015
0644
edit
dl
rm
iso8859_6.py
10833
0644
edit
dl
rm
iso8859_7.py
12844
0644
edit
dl
rm
iso8859_8.py
11036
0644
edit
dl
rm
iso8859_9.py
13156
0644
edit
dl
rm
iso8859_10.py
13589
0644
edit
dl
rm
iso8859_11.py
12335
0644
edit
dl
rm
iso8859_13.py
13271
0644
edit
dl
rm
iso8859_14.py
13652
0644
edit
dl
rm
iso8859_15.py
13212
0644
edit
dl
rm
iso8859_16.py
13557
0644
edit
dl
rm
johab.py
1023
0644
edit
dl
rm
koi8_r.py
13779
0644
edit
dl
rm
koi8_t.py
13193
0644
edit
dl
rm
koi8_u.py
13762
0644
edit
dl
rm
kz1048.py
13723
0644
edit
dl
rm
latin_1.py
1264
0644
edit
dl
rm
mac_arabic.py
36467
0644
edit
dl
rm
mac_croatian.py
13633
0644
edit
dl
rm
mac_cyrillic.py
13454
0644
edit
dl
rm
mac_farsi.py
15170
0644
edit
dl
rm
mac_greek.py
13721
0644
edit
dl
rm
mac_iceland.py
13498
0644
edit
dl
rm
mac_latin2.py
14118
0644
edit
dl
rm
mac_roman.py
13480
0644
edit
dl
rm
mac_romanian.py
13661
0644
edit
dl
rm
mac_turkish.py
13513
0644
edit
dl
rm
mbcs.py
1211
0644
edit
dl
rm
oem.py
1019
0644
edit
dl
rm
palmos.py
13519
0644
edit
dl
rm
ptcp154.py
14015
0644
edit
dl
rm
punycode.py
6883
0644
edit
dl
rm
quopri_codec.py
1525
0644
edit
dl
rm
raw_unicode_escape.py
1332
0644
edit
dl
rm
rot_13.py
2449
0755
edit
dl
rm
shift_jis.py
1039
0644
edit
dl
rm
shift_jisx0213.py
1059
0644
edit
dl
rm
shift_jis_2004.py
1059
0644
edit
dl
rm
tis_620.py
12300
0644
edit
dl
rm
undefined.py
1299
0644
edit
dl
rm
unicode_escape.py
1304
0644
edit
dl
rm
utf_7.py
946
0644
edit
dl
rm
utf_8.py
1005
0644
edit
dl
rm
utf_8_sig.py
4133
0644
edit
dl
rm
utf_16.py
5236
0644
edit
dl
rm
utf_16_be.py
1037
0644
edit
dl
rm
utf_16_le.py
1037
0644
edit
dl
rm
utf_32.py
5129
0644
edit
dl
rm
utf_32_be.py
930
0644
edit
dl
rm
utf_32_le.py
930
0644
edit
dl
rm
uu_codec.py
2851
0644
edit
dl
rm
zlib_codec.py
2204
0644
edit
dl
rm
__init__.py
5884
0644
edit
dl
rm
Edit:
/snap/core24/1587/usr/lib/python3.12/encodings/utf_32.py
(5129B)
""" Python 'utf-32' Codec """ import codecs, sys ### Codec APIs encode = codecs.utf_32_encode def decode(input, errors='strict'): return codecs.utf_32_decode(input, errors, True) class IncrementalEncoder(codecs.IncrementalEncoder): def __init__(self, errors='strict'): codecs.IncrementalEncoder.__init__(self, errors) self.encoder = None def encode(self, input, final=False): if self.encoder is None: result = codecs.utf_32_encode(input, self.errors)[0] if sys.byteorder == 'little': self.encoder = codecs.utf_32_le_encode else: self.encoder = codecs.utf_32_be_encode return result return self.encoder(input, self.errors)[0] def reset(self): codecs.IncrementalEncoder.reset(self) self.encoder = None def getstate(self): # state info we return to the caller: # 0: stream is in natural order for this platform # 2: endianness hasn't been determined yet # (we're never writing in unnatural order) return (2 if self.encoder is None else 0) def setstate(self, state): if state: self.encoder = None else: if sys.byteorder == 'little': self.encoder = codecs.utf_32_le_encode else: self.encoder = codecs.utf_32_be_encode class IncrementalDecoder(codecs.BufferedIncrementalDecoder): def __init__(self, errors='strict'): codecs.BufferedIncrementalDecoder.__init__(self, errors) self.decoder = None def _buffer_decode(self, input, errors, final): if self.decoder is None: (output, consumed, byteorder) = \ codecs.utf_32_ex_decode(input, errors, 0, final) if byteorder == -1: self.decoder = codecs.utf_32_le_decode elif byteorder == 1: self.decoder = codecs.utf_32_be_decode elif consumed >= 4: raise UnicodeError("UTF-32 stream does not start with BOM") return (output, consumed) return self.decoder(input, self.errors, final) def reset(self): codecs.BufferedIncrementalDecoder.reset(self) self.decoder = None def getstate(self): # additional state info from the base class must be None here, # as it isn't passed along to the caller state = codecs.BufferedIncrementalDecoder.getstate(self)[0] # additional state info we pass to the caller: # 0: stream is in natural order for this platform # 1: stream is in unnatural order # 2: endianness hasn't been determined yet if self.decoder is None: return (state, 2) addstate = int((sys.byteorder == "big") != (self.decoder is codecs.utf_32_be_decode)) return (state, addstate) def setstate(self, state): # state[1] will be ignored by BufferedIncrementalDecoder.setstate() codecs.BufferedIncrementalDecoder.setstate(self, state) state = state[1] if state == 0: self.decoder = (codecs.utf_32_be_decode if sys.byteorder == "big" else codecs.utf_32_le_decode) elif state == 1: self.decoder = (codecs.utf_32_le_decode if sys.byteorder == "big" else codecs.utf_32_be_decode) else: self.decoder = None class StreamWriter(codecs.StreamWriter): def __init__(self, stream, errors='strict'): self.encoder = None codecs.StreamWriter.__init__(self, stream, errors) def reset(self): codecs.StreamWriter.reset(self) self.encoder = None def encode(self, input, errors='strict'): if self.encoder is None: result = codecs.utf_32_encode(input, errors) if sys.byteorder == 'little': self.encoder = codecs.utf_32_le_encode else: self.encoder = codecs.utf_32_be_encode return result else: return self.encoder(input, errors) class StreamReader(codecs.StreamReader): def reset(self): codecs.StreamReader.reset(self) try: del self.decode except AttributeError: pass def decode(self, input, errors='strict'): (object, consumed, byteorder) = \ codecs.utf_32_ex_decode(input, errors, 0, False) if byteorder == -1: self.decode = codecs.utf_32_le_decode elif byteorder == 1: self.decode = codecs.utf_32_be_decode elif consumed>=4: raise UnicodeError("UTF-32 stream does not start with BOM") return (object, consumed) ### encodings module API def getregentry(): return codecs.CodecInfo( name='utf-32', encode=encode, decode=decode, incrementalencoder=IncrementalEncoder, incrementaldecoder=IncrementalDecoder, streamreader=StreamReader, streamwriter=StreamWriter, )
Save
cmd:
run