PATH: //proc/self/root/opt/alt/python-internal/lib64/python3.11/encodings
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 __init__.py
↓
X
📁 __pycache__/
X
📄 aliases.py
↓
X
📄 ascii.py
↓
X
📄 base64_codec.py
↓
X
📄 big5.py
↓
X
📄 big5hkscs.py
↓
X
📄 bz2_codec.py
↓
X
📄 charmap.py
↓
X
📄 cp037.py
↓
X
📄 cp1006.py
↓
X
📄 cp1026.py
↓
X
📄 cp1125.py
↓
X
📄 cp1140.py
↓
X
📄 cp1250.py
↓
X
📄 cp1251.py
↓
X
📄 cp1252.py
↓
X
📄 cp1253.py
↓
X
📄 cp1254.py
↓
X
📄 cp1255.py
↓
X
📄 cp1256.py
↓
X
📄 cp1257.py
↓
X
📄 cp1258.py
↓
X
📄 cp273.py
↓
X
📄 cp424.py
↓
X
📄 cp437.py
↓
X
📄 cp500.py
↓
X
📄 cp720.py
↓
X
📄 cp737.py
↓
X
📄 cp775.py
↓
X
📄 cp850.py
↓
X
📄 cp852.py
↓
X
📄 cp855.py
↓
X
📄 cp856.py
↓
X
📄 cp857.py
↓
X
📄 cp858.py
↓
X
📄 cp860.py
↓
X
📄 cp861.py
↓
X
📄 cp862.py
↓
X
📄 cp863.py
↓
X
📄 cp864.py
↓
X
📄 cp865.py
↓
X
📄 cp866.py
↓
X
📄 cp869.py
↓
X
📄 cp874.py
↓
X
📄 cp875.py
↓
X
📄 cp932.py
↓
X
📄 cp949.py
↓
X
📄 cp950.py
↓
X
📄 euc_jis_2004.py
↓
X
📄 euc_jisx0213.py
↓
X
📄 euc_jp.py
↓
X
📄 euc_kr.py
↓
X
📄 gb18030.py
↓
X
📄 gb2312.py
↓
X
📄 gbk.py
↓
X
📄 hex_codec.py
↓
X
📄 hp_roman8.py
↓
X
📄 hz.py
↓
X
📄 idna.py
↓
X
📄 iso2022_jp.py
↓
X
📄 iso2022_jp_1.py
↓
X
📄 iso2022_jp_2.py
↓
X
📄 iso2022_jp_2004.py
↓
X
📄 iso2022_jp_3.py
↓
X
📄 iso2022_jp_ext.py
↓
X
📄 iso2022_kr.py
↓
X
📄 iso8859_1.py
↓
X
📄 iso8859_10.py
↓
X
📄 iso8859_11.py
↓
X
📄 iso8859_13.py
↓
X
📄 iso8859_14.py
↓
X
📄 iso8859_15.py
↓
X
📄 iso8859_16.py
↓
X
📄 iso8859_2.py
↓
X
📄 iso8859_3.py
↓
X
📄 iso8859_4.py
↓
X
📄 iso8859_5.py
↓
X
📄 iso8859_6.py
↓
X
📄 iso8859_7.py
↓
X
📄 iso8859_8.py
↓
X
📄 iso8859_9.py
↓
X
📄 johab.py
↓
X
📄 koi8_r.py
↓
X
📄 koi8_t.py
↓
X
📄 koi8_u.py
↓
X
📄 kz1048.py
↓
X
📄 latin_1.py
↓
X
📄 mac_arabic.py
↓
X
📄 mac_croatian.py
↓
X
📄 mac_cyrillic.py
↓
X
📄 mac_farsi.py
↓
X
📄 mac_greek.py
↓
X
📄 mac_iceland.py
↓
X
📄 mac_latin2.py
↓
X
📄 mac_roman.py
↓
X
📄 mac_romanian.py
↓
X
📄 mac_turkish.py
↓
X
📄 mbcs.py
↓
X
📄 oem.py
↓
X
📄 palmos.py
↓
X
📄 ptcp154.py
↓
X
📄 punycode.py
↓
X
📄 quopri_codec.py
↓
X
📄 raw_unicode_escape.py
↓
X
📄 rot_13.py
↓
X
📄 shift_jis.py
↓
X
📄 shift_jis_2004.py
↓
X
📄 shift_jisx0213.py
↓
X
📄 tis_620.py
↓
X
📄 undefined.py
↓
X
📄 unicode_escape.py
↓
X
📄 utf_16.py
↓
X
📄 utf_16_be.py
↓
X
📄 utf_16_le.py
↓
X
📄 utf_32.py
↓
X
📄 utf_32_be.py
↓
X
📄 utf_32_le.py
↓
X
📄 utf_7.py
↓
X
📄 utf_8.py
↓
X
📄 utf_8_sig.py
↓
X
📄 uu_codec.py
↓
X
📄 zlib_codec.py
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: utf_8_sig.py
""" Python 'utf-8-sig' Codec This work similar to UTF-8 with the following changes: * On encoding/writing a UTF-8 encoded BOM will be prepended/written as the first three bytes. * On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these bytes will be skipped. """ import codecs ### Codec APIs def encode(input, errors='strict'): return (codecs.BOM_UTF8 + codecs.utf_8_encode(input, errors)[0], len(input)) def decode(input, errors='strict'): prefix = 0 if input[:3] == codecs.BOM_UTF8: input = input[3:] prefix = 3 (output, consumed) = codecs.utf_8_decode(input, errors, True) return (output, consumed+prefix) class IncrementalEncoder(codecs.IncrementalEncoder): def __init__(self, errors='strict'): codecs.IncrementalEncoder.__init__(self, errors) self.first = 1 def encode(self, input, final=False): if self.first: self.first = 0 return codecs.BOM_UTF8 + \ codecs.utf_8_encode(input, self.errors)[0] else: return codecs.utf_8_encode(input, self.errors)[0] def reset(self): codecs.IncrementalEncoder.reset(self) self.first = 1 def getstate(self): return self.first def setstate(self, state): self.first = state class IncrementalDecoder(codecs.BufferedIncrementalDecoder): def __init__(self, errors='strict'): codecs.BufferedIncrementalDecoder.__init__(self, errors) self.first = 1 def _buffer_decode(self, input, errors, final): if self.first: if len(input) < 3: if codecs.BOM_UTF8.startswith(input): # not enough data to decide if this really is a BOM # => try again on the next call return ("", 0) else: self.first = 0 else: self.first = 0 if input[:3] == codecs.BOM_UTF8: (output, consumed) = \ codecs.utf_8_decode(input[3:], errors, final) return (output, consumed+3) return codecs.utf_8_decode(input, errors, final) def reset(self): codecs.BufferedIncrementalDecoder.reset(self) self.first = 1 def getstate(self): state = codecs.BufferedIncrementalDecoder.getstate(self) # state[1] must be 0 here, as it isn't passed along to the caller return (state[0], self.first) def setstate(self, state): # state[1] will be ignored by BufferedIncrementalDecoder.setstate() codecs.BufferedIncrementalDecoder.setstate(self, state) self.first = state[1] class StreamWriter(codecs.StreamWriter): def reset(self): codecs.StreamWriter.reset(self) try: del self.encode except AttributeError: pass def encode(self, input, errors='strict'): self.encode = codecs.utf_8_encode return encode(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'): if len(input) < 3: if codecs.BOM_UTF8.startswith(input): # not enough data to decide if this is a BOM # => try again on the next call return ("", 0) elif input[:3] == codecs.BOM_UTF8: self.decode = codecs.utf_8_decode (output, consumed) = codecs.utf_8_decode(input[3:],errors) return (output, consumed+3) # (else) no BOM present self.decode = codecs.utf_8_decode return codecs.utf_8_decode(input, errors) ### encodings module API def getregentry(): return codecs.CodecInfo( name='utf-8-sig', encode=encode, decode=decode, incrementalencoder=IncrementalEncoder, incrementaldecoder=IncrementalDecoder, streamreader=StreamReader, streamwriter=StreamWriter, )
SIMPAN PERUBAHAN