iso8859_1.py 953 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. """ Python Character Mapping Codec generated from '8859-1.TXT' with gencodec.py.
  2. Written by Marc-Andre Lemburg ([email protected]).
  3. (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
  4. (c) Copyright 2000 Guido van Rossum.
  5. """#"
  6. import codecs
  7. ### Codec APIs
  8. class Codec(codecs.Codec):
  9. def encode(self,input,errors='strict'):
  10. return codecs.charmap_encode(input,errors,encoding_map)
  11. def decode(self,input,errors='strict'):
  12. return codecs.charmap_decode(input,errors,decoding_map)
  13. class StreamWriter(Codec,codecs.StreamWriter):
  14. pass
  15. class StreamReader(Codec,codecs.StreamReader):
  16. pass
  17. ### encodings module API
  18. def getregentry():
  19. return (Codec().encode,Codec().decode,StreamReader,StreamWriter)
  20. ### Decoding Map
  21. decoding_map = codecs.make_identity_dict(range(256))
  22. decoding_map.update({
  23. })
  24. ### Encoding Map
  25. encoding_map = codecs.make_encoding_map(decoding_map)