Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 1 | """ Python 'raw-unicode-escape' Codec |
| 2 | |
| 3 | |
| 4 | Written by Marc-Andre Lemburg (mal@lemburg.com). |
| 5 | |
| 6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. |
| 7 | |
| 8 | """ |
| 9 | import codecs |
| 10 | |
| 11 | ### Codec APIs |
| 12 | |
| 13 | class Codec(codecs.Codec): |
| 14 | |
| 15 | # Note: Binding these as C functions will result in the class not |
| 16 | # converting them to methods. This is intended. |
| 17 | encode = codecs.raw_unicode_escape_encode |
| 18 | decode = codecs.raw_unicode_escape_decode |
| 19 | |
| 20 | class StreamWriter(Codec,codecs.StreamWriter): |
| 21 | pass |
Tim Peters | 469cdad | 2002-08-08 20:19:19 +0000 | [diff] [blame] | 22 | |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 23 | class StreamReader(Codec,codecs.StreamReader): |
| 24 | pass |
| 25 | |
| 26 | ### encodings module API |
| 27 | |
| 28 | def getregentry(): |
| 29 | |
| 30 | return (Codec.encode,Codec.decode,StreamReader,StreamWriter) |