mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-133968: Add PyUnicodeWriter_WriteASCII() function (#133973)
Replace most PyUnicodeWriter_WriteUTF8() calls with
PyUnicodeWriter_WriteASCII().
(cherry picked from commit f49a07b531
)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
parent
dba307a757
commit
3d69d18322
16 changed files with 98 additions and 31 deletions
|
@ -14108,6 +14108,20 @@ _PyUnicodeWriter_WriteASCIIString(_PyUnicodeWriter *writer,
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
PyUnicodeWriter_WriteASCII(PyUnicodeWriter *writer,
|
||||
const char *str,
|
||||
Py_ssize_t size)
|
||||
{
|
||||
assert(writer != NULL);
|
||||
_Py_AssertHoldsTstate();
|
||||
|
||||
_PyUnicodeWriter *priv_writer = (_PyUnicodeWriter*)writer;
|
||||
return _PyUnicodeWriter_WriteASCIIString(priv_writer, str, size);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
PyUnicodeWriter_WriteUTF8(PyUnicodeWriter *writer,
|
||||
const char *str,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue