winsami2
Python Character Mapping Codec for winsami2.
Codec
Bases: codecs.Codec
Implement the interface for stateless encoders/decoders.
Source code in /home/anders/projects/CorpusTools/corpustools/winsami2.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
decode(instring, errors='strict')
Decode the object instring.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instring |
str
|
the string that should be decoded with this codec. |
required |
errors |
str
|
define the error handling to apply. One of 'strict', 'replace' or 'ignore'. |
'strict'
|
Returns:
Type | Description |
---|---|
tuple[bytes, int]
|
A tuple of output object and the length consumed |
Source code in /home/anders/projects/CorpusTools/corpustools/winsami2.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
encode(instring, errors='strict')
Encode the object instring.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instring |
str
|
the string that should be encoded with this codec. |
required |
errors |
str
|
define the error handling to apply. One of 'strict', 'replace', 'ignore', 'xmlcharrefreplace' or 'backslashreplace'. |
'strict'
|
Returns:
Type | Description |
---|---|
tuple[bytes, int]
|
A tuple of the output object and the length consumed |
Source code in /home/anders/projects/CorpusTools/corpustools/winsami2.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
IncrementalDecoder
Bases: codecs.IncrementalDecoder
Implement an IncrementalDecoder.
Source code in /home/anders/projects/CorpusTools/corpustools/winsami2.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
decode(instring, final=False)
Decode instring.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instring |
str
|
the string that should be decoded with this codec. |
required |
Returns:
Type | Description |
---|---|
tuple[bytes, int]
|
A tuple of the output object and the length consumed |
Source code in /home/anders/projects/CorpusTools/corpustools/winsami2.py
66 67 68 69 70 71 72 73 74 75 76 77 |
|
IncrementalEncoder
Bases: codecs.IncrementalEncoder
Implement an IncrementalEncoder.
Source code in /home/anders/projects/CorpusTools/corpustools/winsami2.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
encode(instring, final=False)
Encode instring.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instring |
str
|
the string that should be encoded with this codec. |
required |
Returns:
Type | Description |
---|---|
tuple[bytes, int]
|
A tuple of the output object and the length consumed |
Source code in /home/anders/projects/CorpusTools/corpustools/winsami2.py
49 50 51 52 53 54 55 56 57 58 59 60 |
|
getregentry()
Get the info for this encoding.
Source code in /home/anders/projects/CorpusTools/corpustools/winsami2.py
83 84 85 86 87 88 89 90 91 92 93 |
|
lookup(encoding)
Lookup the name of the encoding.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
encoding |
str
|
name of the encoding |
required |
Returns:
Type | Description |
---|---|
Codecs.CodecInfo | None
|
Codecs.CodecInfo if encoding is the name of the encoding of this file, None otherwise. |
Source code in /home/anders/projects/CorpusTools/corpustools/winsami2.py
361 362 363 364 365 366 367 368 369 370 371 372 373 |
|