2 # iso2022_jp_2004.py: Python Unicode Codec for ISO2022_JP_2004
4 # Written by Hye-Shik Chang <perky@FreeBSD.org>
7 import _codecs_iso2022
, codecs
8 import _multibytecodec
as mbc
10 codec
= _codecs_iso2022
.getcodec('iso2022_jp_2004')
12 class Codec(codecs
.Codec
):
16 class IncrementalEncoder(mbc
.MultibyteIncrementalEncoder
,
17 codecs
.IncrementalEncoder
):
20 class IncrementalDecoder(mbc
.MultibyteIncrementalDecoder
,
21 codecs
.IncrementalDecoder
):
24 class StreamReader(Codec
, mbc
.MultibyteStreamReader
, codecs
.StreamReader
):
27 class StreamWriter(Codec
, mbc
.MultibyteStreamWriter
, codecs
.StreamWriter
):
31 return codecs
.CodecInfo(
32 name
='iso2022_jp_2004',
33 encode
=Codec().encode
,
34 decode
=Codec().decode
,
35 incrementalencoder
=IncrementalEncoder
,
36 incrementaldecoder
=IncrementalDecoder
,
37 streamreader
=StreamReader
,
38 streamwriter
=StreamWriter
,