Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
allendowney
GitHub Repository: allendowney/cpython
Path: blob/main/Include/internal/pycore_codecs.h
12 views
1
#ifndef Py_INTERNAL_CODECS_H
2
#define Py_INTERNAL_CODECS_H
3
#ifdef __cplusplus
4
extern "C" {
5
#endif
6
7
extern PyObject* _PyCodec_Lookup(const char *encoding);
8
9
extern int _PyCodec_Forget(const char *encoding);
10
11
/* Text codec specific encoding and decoding API.
12
13
Checks the encoding against a list of codecs which do not
14
implement a str<->bytes encoding before attempting the
15
operation.
16
17
Please note that these APIs are internal and should not
18
be used in Python C extensions.
19
20
XXX (ncoghlan): should we make these, or something like them, public
21
in Python 3.5+?
22
23
*/
24
extern PyObject* _PyCodec_LookupTextEncoding(
25
const char *encoding,
26
const char *alternate_command);
27
28
extern PyObject* _PyCodec_EncodeText(
29
PyObject *object,
30
const char *encoding,
31
const char *errors);
32
33
extern PyObject* _PyCodec_DecodeText(
34
PyObject *object,
35
const char *encoding,
36
const char *errors);
37
38
/* These two aren't actually text encoding specific, but _io.TextIOWrapper
39
* is the only current API consumer.
40
*/
41
extern PyObject* _PyCodecInfo_GetIncrementalDecoder(
42
PyObject *codec_info,
43
const char *errors);
44
45
extern PyObject* _PyCodecInfo_GetIncrementalEncoder(
46
PyObject *codec_info,
47
const char *errors);
48
49
50
#ifdef __cplusplus
51
}
52
#endif
53
#endif /* !Py_INTERNAL_CODECS_H */
54
55