iso8859_8.py 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. """ Python Character Mapping Codec generated from '8859-8.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. 0x00a1: None,
  24. 0x00aa: 0x00d7, # MULTIPLICATION SIGN
  25. 0x00ba: 0x00f7, # DIVISION SIGN
  26. 0x00bf: None,
  27. 0x00c0: None,
  28. 0x00c1: None,
  29. 0x00c2: None,
  30. 0x00c3: None,
  31. 0x00c4: None,
  32. 0x00c5: None,
  33. 0x00c6: None,
  34. 0x00c7: None,
  35. 0x00c8: None,
  36. 0x00c9: None,
  37. 0x00ca: None,
  38. 0x00cb: None,
  39. 0x00cc: None,
  40. 0x00cd: None,
  41. 0x00ce: None,
  42. 0x00cf: None,
  43. 0x00d0: None,
  44. 0x00d1: None,
  45. 0x00d2: None,
  46. 0x00d3: None,
  47. 0x00d4: None,
  48. 0x00d5: None,
  49. 0x00d6: None,
  50. 0x00d7: None,
  51. 0x00d8: None,
  52. 0x00d9: None,
  53. 0x00da: None,
  54. 0x00db: None,
  55. 0x00dc: None,
  56. 0x00dd: None,
  57. 0x00de: None,
  58. 0x00df: 0x2017, # DOUBLE LOW LINE
  59. 0x00e0: 0x05d0, # HEBREW LETTER ALEF
  60. 0x00e1: 0x05d1, # HEBREW LETTER BET
  61. 0x00e2: 0x05d2, # HEBREW LETTER GIMEL
  62. 0x00e3: 0x05d3, # HEBREW LETTER DALET
  63. 0x00e4: 0x05d4, # HEBREW LETTER HE
  64. 0x00e5: 0x05d5, # HEBREW LETTER VAV
  65. 0x00e6: 0x05d6, # HEBREW LETTER ZAYIN
  66. 0x00e7: 0x05d7, # HEBREW LETTER HET
  67. 0x00e8: 0x05d8, # HEBREW LETTER TET
  68. 0x00e9: 0x05d9, # HEBREW LETTER YOD
  69. 0x00ea: 0x05da, # HEBREW LETTER FINAL KAF
  70. 0x00eb: 0x05db, # HEBREW LETTER KAF
  71. 0x00ec: 0x05dc, # HEBREW LETTER LAMED
  72. 0x00ed: 0x05dd, # HEBREW LETTER FINAL MEM
  73. 0x00ee: 0x05de, # HEBREW LETTER MEM
  74. 0x00ef: 0x05df, # HEBREW LETTER FINAL NUN
  75. 0x00f0: 0x05e0, # HEBREW LETTER NUN
  76. 0x00f1: 0x05e1, # HEBREW LETTER SAMEKH
  77. 0x00f2: 0x05e2, # HEBREW LETTER AYIN
  78. 0x00f3: 0x05e3, # HEBREW LETTER FINAL PE
  79. 0x00f4: 0x05e4, # HEBREW LETTER PE
  80. 0x00f5: 0x05e5, # HEBREW LETTER FINAL TSADI
  81. 0x00f6: 0x05e6, # HEBREW LETTER TSADI
  82. 0x00f7: 0x05e7, # HEBREW LETTER QOF
  83. 0x00f8: 0x05e8, # HEBREW LETTER RESH
  84. 0x00f9: 0x05e9, # HEBREW LETTER SHIN
  85. 0x00fa: 0x05ea, # HEBREW LETTER TAV
  86. 0x00fb: None,
  87. 0x00fc: None,
  88. 0x00fd: 0x200e, # LEFT-TO-RIGHT MARK
  89. 0x00fe: 0x200f, # RIGHT-TO-LEFT MARK
  90. 0x00ff: None,
  91. })
  92. ### Encoding Map
  93. encoding_map = codecs.make_encoding_map(decoding_map)