Lines Matching defs:encoding
612 "decode($self, /, encoding=\'utf-8\', errors=\'strict\')\n"
615 "Decode the bytes using the codec registered for encoding.\n"
617 " encoding\n"
618 " The encoding with which to decode the bytes.\n"
630 bytes_decode_impl(PyBytesObject *self, const char *encoding,
637 static const char * const _keywords[] = {"encoding", "errors", NULL};
641 const char *encoding = NULL;
653 _PyArg_BadArgument("decode", "argument 'encoding'", "str", args[0]);
657 encoding = PyUnicode_AsUTF8AndSize(args[0], &encoding_length);
658 if (encoding == NULL) {
661 if (strlen(encoding) != (size_t)encoding_length) {
683 return_value = bytes_decode_impl(self, encoding, errors);
832 bytes_new_impl(PyTypeObject *type, PyObject *x, const char *encoding,
839 static const char * const _keywords[] = {"source", "encoding", "errors", NULL};
846 const char *encoding = NULL;
864 _PyArg_BadArgument("bytes", "argument 'encoding'", "str", fastargs[1]);
868 encoding = PyUnicode_AsUTF8AndSize(fastargs[1], &encoding_length);
869 if (encoding == NULL) {
872 if (strlen(encoding) != (size_t)encoding_length) {
894 return_value = bytes_new_impl(type, x, encoding, errors);