Le lun. 29 juin 2020 à 08:41, Inada Naoki <songofaca...@gmail.com> a écrit : > That's all. > Now I think it is safe to override deprecated APIs with private APIs > accepts Unicode Object. > > * _PyUnicode_EncodeUTF7 -> PyUnicode_EncodeUTF7
Use PyUnicode_AsEncodedString("UTF-7"). This encoding is not common enough to justify to have to maintain a public C API for just it. Adding public C API functions have a cost in CPython, but also in other Python implementations which then have to maintain it as well. The C API is too large, we have to make it smaller, not larger. > * _PyUnicode_AsUTF8String -> PyUnicode_EncodeUTF8 Use PyUnicode_AsUTF8String(), or PyUnicode_AsEncodedString() if you need to pass errors. > * _PyUnicode_EncodeUTF16 -> PyUnicode_EncodeUTF16 Use PyUnicode_AsUTF16String(), or PyUnicode_AsEncodedString() if you need to pass errors or the byte order. > * _PyUnicode_EncodeUTF32 -> PyUnicode_EncodeUTF32 Who use UTF32? There is PyUnicode_AsUTF32String(). > * _PyUnicode_AsLatin1String -> PyUnicode_EncodeLatin1 PyUnicode_AsLatin1String() > * _PyUnicode_AsASCIIString -> PyUnicode_EncodeASCII PyUnicode_AsASCIIString() > * _PyUnicode_EncodeCharmap -> PyUnicode_EncodeCharmap PyUnicode_AsCharmapString() Victor -- Night gathers, and now my watch begins. It shall not end until my death. _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/4B4HSQSW4ZFNOAJATV5XMPGWF5TSNZRN/ Code of Conduct: http://python.org/psf/codeofconduct/