Lines Matching defs:encoding
133 "encode($self, /, encoding=\'utf-8\', errors=\'strict\')\n"
136 "Encode the string using the codec registered for encoding.\n"
138 " encoding\n"
139 " The encoding in which to encode the string.\n"
141 " The error handling scheme to use for encoding errors.\n"
142 " The default is \'strict\' meaning that encoding errors raise a\n"
151 unicode_encode_impl(PyObject *self, const char *encoding, const char *errors);
157 static const char * const _keywords[] = {"encoding", "errors", NULL};
161 const char *encoding = NULL;
173 _PyArg_BadArgument("encode", "argument 'encoding'", "str", args[0]);
177 encoding = PyUnicode_AsUTF8AndSize(args[0], &encoding_length);
178 if (encoding == NULL) {
181 if (strlen(encoding) != (size_t)encoding_length) {
203 return_value = unicode_encode_impl(self, encoding, errors);
1289 unicode_new_impl(PyTypeObject *type, PyObject *x, const char *encoding,
1296 static const char * const _keywords[] = {"object", "encoding", "errors", NULL};
1303 const char *encoding = NULL;
1321 _PyArg_BadArgument("str", "argument 'encoding'", "str", fastargs[1]);
1325 encoding = PyUnicode_AsUTF8AndSize(fastargs[1], &encoding_length);
1326 if (encoding == NULL) {
1329 if (strlen(encoding) != (size_t)encoding_length) {
1351 return_value = unicode_new_impl(type, x, encoding, errors);