MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / PyUnicodeWriter_WriteUTF8

Function PyUnicodeWriter_WriteUTF8

asyncpg/protocol/record/pythoncapi_compat.h:1441–1457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1439}
1440
1441static inline int
1442PyUnicodeWriter_WriteUTF8(PyUnicodeWriter *writer,
1443 const char *str, Py_ssize_t size)
1444{
1445 if (size < 0) {
1446 size = (Py_ssize_t)strlen(str);
1447 }
1448
1449 PyObject *str_obj = PyUnicode_FromStringAndSize(str, size);
1450 if (str_obj == _Py_NULL) {
1451 return -1;
1452 }
1453
1454 int res = _PyUnicodeWriter_WriteStr((_PyUnicodeWriter*)writer, str_obj);
1455 Py_DECREF(str_obj);
1456 return res;
1457}
1458
1459static inline int
1460PyUnicodeWriter_WriteASCII(PyUnicodeWriter *writer,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected