@@ -725,17 +725,15 @@ ascii_encode(textio *self, PyObject *text)
725725static PyObject *
726726utf16be_encode (textio * self , PyObject * text )
727727{
728- return PyUnicode_EncodeUTF16 (PyUnicode_AS_UNICODE (text ),
729- PyUnicode_GET_SIZE (text ),
730- PyBytes_AS_STRING (self -> errors ), 1 );
728+ return _PyUnicode_EncodeUTF16 (text ,
729+ PyBytes_AS_STRING (self -> errors ), 1 );
731730}
732731
733732static PyObject *
734733utf16le_encode (textio * self , PyObject * text )
735734{
736- return PyUnicode_EncodeUTF16 (PyUnicode_AS_UNICODE (text ),
737- PyUnicode_GET_SIZE (text ),
738- PyBytes_AS_STRING (self -> errors ), -1 );
735+ return _PyUnicode_EncodeUTF16 (text ,
736+ PyBytes_AS_STRING (self -> errors ), -1 );
739737}
740738
741739static PyObject *
@@ -749,25 +747,22 @@ utf16_encode(textio *self, PyObject *text)
749747 return utf16le_encode (self , text );
750748#endif
751749 }
752- return PyUnicode_EncodeUTF16 (PyUnicode_AS_UNICODE (text ),
753- PyUnicode_GET_SIZE (text ),
754- PyBytes_AS_STRING (self -> errors ), 0 );
750+ return _PyUnicode_EncodeUTF16 (text ,
751+ PyBytes_AS_STRING (self -> errors ), 0 );
755752}
756753
757754static PyObject *
758755utf32be_encode (textio * self , PyObject * text )
759756{
760- return PyUnicode_EncodeUTF32 (PyUnicode_AS_UNICODE (text ),
761- PyUnicode_GET_SIZE (text ),
762- PyBytes_AS_STRING (self -> errors ), 1 );
757+ return _PyUnicode_EncodeUTF32 (text ,
758+ PyBytes_AS_STRING (self -> errors ), 1 );
763759}
764760
765761static PyObject *
766762utf32le_encode (textio * self , PyObject * text )
767763{
768- return PyUnicode_EncodeUTF32 (PyUnicode_AS_UNICODE (text ),
769- PyUnicode_GET_SIZE (text ),
770- PyBytes_AS_STRING (self -> errors ), -1 );
764+ return _PyUnicode_EncodeUTF32 (text ,
765+ PyBytes_AS_STRING (self -> errors ), -1 );
771766}
772767
773768static PyObject *
@@ -781,9 +776,8 @@ utf32_encode(textio *self, PyObject *text)
781776 return utf32le_encode (self , text );
782777#endif
783778 }
784- return PyUnicode_EncodeUTF32 (PyUnicode_AS_UNICODE (text ),
785- PyUnicode_GET_SIZE (text ),
786- PyBytes_AS_STRING (self -> errors ), 0 );
779+ return _PyUnicode_EncodeUTF32 (text ,
780+ PyBytes_AS_STRING (self -> errors ), 0 );
787781}
788782
789783static PyObject *
0 commit comments