@@ -1476,13 +1476,13 @@ encoder_listencode_obj(PyEncoderObject *s, PyUnicodeWriter *writer,
14761476 int rv ;
14771477
14781478 if (obj == Py_None ) {
1479- return PyUnicodeWriter_WriteUTF8 (writer , "null" , 4 );
1479+ return PyUnicodeWriter_WriteASCII (writer , "null" , 4 );
14801480 }
14811481 else if (obj == Py_True ) {
1482- return PyUnicodeWriter_WriteUTF8 (writer , "true" , 4 );
1482+ return PyUnicodeWriter_WriteASCII (writer , "true" , 4 );
14831483 }
14841484 else if (obj == Py_False ) {
1485- return PyUnicodeWriter_WriteUTF8 (writer , "false" , 5 );
1485+ return PyUnicodeWriter_WriteASCII (writer , "false" , 5 );
14861486 }
14871487 else if (PyUnicode_Check (obj )) {
14881488 PyObject * encoded = encoder_encode_string (s , obj );
@@ -1655,7 +1655,7 @@ encoder_listencode_dict(PyEncoderObject *s, PyUnicodeWriter *writer,
16551655
16561656 if (PyDict_GET_SIZE (dct ) == 0 ) {
16571657 /* Fast path */
1658- return PyUnicodeWriter_WriteUTF8 (writer , "{}" , 2 );
1658+ return PyUnicodeWriter_WriteASCII (writer , "{}" , 2 );
16591659 }
16601660
16611661 if (s -> markers != Py_None ) {
@@ -1756,7 +1756,7 @@ encoder_listencode_list(PyEncoderObject *s, PyUnicodeWriter *writer,
17561756 return -1 ;
17571757 if (PySequence_Fast_GET_SIZE (s_fast ) == 0 ) {
17581758 Py_DECREF (s_fast );
1759- return PyUnicodeWriter_WriteUTF8 (writer , "[]" , 2 );
1759+ return PyUnicodeWriter_WriteASCII (writer , "[]" , 2 );
17601760 }
17611761
17621762 if (s -> markers != Py_None ) {
0 commit comments