summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/unicode.rst
Commit message (Collapse)AuthorAgeFilesLines
* gh-93738: Documentation C syntax (:c:type:<C type> -> :c:expr:<C type>) (#97768)Adam Turner2022-10-051-12/+12
| | | | | :c:type:`<C type>` -> :c:expr:`<C type>` Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-93738: Documentation C syntax (:c:type:`PyBytesObject*` -> ↵Adam Turner2022-10-041-1/+1
| | | | | :c:expr:`PyBytesObject*`) (#97782) :c:type:`PyBytesObject*` -> :c:expr:`PyBytesObject*`
* gh-93738: Documentation C syntax (:c:type:`PyUnicodeObject*` -> ↵Adam Turner2022-10-041-1/+1
| | | | | :c:expr:`PyUnicodeObject*`) (#97783) :c:type:`PyUnicodeObject*` -> :c:expr:`PyUnicodeObject*`
* gh-95781: More strict format string checking in PyUnicode_FromFormatV() ↵Serhiy Storchaka2022-08-081-3/+5
| | | | | | | | | (GH-95784) An unrecognized format character in PyUnicode_FromFormat() and PyUnicode_FromFormatV() now sets a SystemError. In previous versions it caused all the rest of the format string to be copied as-is to the result string, and any extra arguments discarded.
* Fix Unicode doc and replace use of macro with PyMem_New function (GH-94088)Pamela Fox2022-07-281-1/+1
|
* gh-93202: Always use %zd printf formatter (#93201)Victor Stinner2022-05-251-4/+0
| | | | | | | | | | | | | | | | Python now always use the ``%zu`` and ``%zd`` printf formats to format a size_t or Py_ssize_t number. Building Python 3.12 requires a C11 compiler, so these printf formats are now always supported. * PyObject_Print() and _PyObject_Dump() now use the printf %zd format to display an object reference count. * Update PY_FORMAT_SIZE_T comment. * Remove outdated notes about the %zd format in PyBytes_FromFormat() and PyUnicode_FromFormat() documentations. * configure no longer checks for the %zd format and no longer defines PY_FORMAT_SIZE_T macro in pyconfig.h. * pymacconfig.h no longer undefines PY_FORMAT_SIZE_T: macOS 10.4 is no longer supported. Python 3.12 now requires macOS 10.6 (Snow Leopard) or newer.
* gh-93103: Update PyUnicode_DecodeFSDefault() doc (#93105)Victor Stinner2022-05-231-38/+24
| | | | | | | Update documentation of PyUnicode_DecodeFSDefault(), PyUnicode_DecodeFSDefaultAndSize() and PyUnicode_EncodeFSDefault(): they now use the filesystem encoding and error handler of PyConfig, Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors variables are no longer used.
* Document Py_ssize_t. (GH-92512)Julien Palard2022-05-131-4/+4
| | | | | | It fixes 252 errors from a Sphinx nitpicky run (sphinx-build -n). But there's 8182 errors left. Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* gh-92536: Doc update about Py_UNICODE removal (GH-92756)Inada Naoki2022-05-131-1/+1
|
* gh-92536: PEP 623: Remove wstr and legacy APIs from Unicode (GH-92537)Inada Naoki2022-05-121-156/+21
|
* gh-89653: PEP 670: Fix Sphinx syntax in Unicode doc (#92707)Victor Stinner2022-05-121-4/+4
|
* gh-89653: PEP 670: unicodeobject.h uses _Py_CAST() (#92696)Victor Stinner2022-05-111-3/+3
| | | | | | | | | | Use _Py_CAST() and _Py_STATIC_CAST() in macros wrapping static inline functions of unicodeobject.h. Change also the kind type from unsigned int to int: same parameter type than PyUnicode_FromKindAndData(). The limited API version 3.11 no longer casts arguments to expected types.
* gh-89653: PEP 670: Update C API unicode documentation (#92702)Victor Stinner2022-05-111-10/+11
|
* Document the lifetime of `PyUnicode_AsUTF8String` (#92325)Matt Wozniski2022-05-061-1/+2
| | | The current wording implied this, but didn't state it explicitly.
* gh-89653: PEP 670: Amend docs (GH-91813)Erlend Egeberg Aasland2022-04-221-11/+12
|
* Minor fixes to C API docs (GH-31501)Jelle Zijlstra2022-02-231-4/+4
| | | | | | | | | | | | | | | | * C API docs: move PyErr_SetImportErrorSubclass docs It was in the section about warnings, but it makes more sense to put it with PyErr_SetImportError. * C API docs: document closeit argument to PyRun_AnyFileExFlags It was already documented for PyRun_SimpleFileExFlags. * textual fixes to unicode docs * Move paragraph about tp_dealloc into tp_dealloc section * __aiter__ returns an async iterator, not an awaitable
* closes bpo-46253: Change Py_UNICODE to Py_UCS4 in the C API docs to match ↵Julian Gilbey2022-01-111-17/+17
| | | | the current source code (GH-30387)
* bpo-43565: Document PyUnicode_KIND's return type as an unsigned int (GH-25724)Ammar Askar2021-07-291-1/+1
|
* bpo-39560: Document PyUnicode_FromKindAndData() kind transformation (GH-23848)Zackery Spytz2021-06-031-0/+6
|
* bpo-44029: Remove Py_UNICODE APIs (GH-25881)Inada Naoki2021-05-071-185/+0
| | | | | | | | | | | | Remove deprecated `Py_UNICODE` APIs: `PyUnicode_Encode`, `PyUnicode_EncodeUTF7`, `PyUnicode_EncodeUTF8`, `PyUnicode_EncodeUTF16`, `PyUnicode_EncodeUTF32`, `PyUnicode_EncodeLatin1`, `PyUnicode_EncodeMBCS`, `PyUnicode_EncodeDecimal`, `PyUnicode_EncodeRawUnicodeEscape`, `PyUnicode_EncodeCharmap`, `PyUnicode_EncodeUnicodeEscape`, `PyUnicode_TransformDecimalToASCII`, `PyUnicode_TranslateCharmap`, `PyUnicodeEncodeError_Create`, `PyUnicodeTranslateError_Create`. See :pep:`393` and :pep:`624` for reference.
* bpo-43506: Doc: Update removal schedule for Py_UNICODE encoder APIs (GH-24885)Inada Naoki2021-03-161-11/+15
| | | See PEP 624.
* bpo-36346: Document removal schedule of deprecate APIs (GH-20879)Inada Naoki2021-02-221-4/+3
| | | We will remove wstr cache in Python 3.12. See PEP 623.
* bpo-42528: Improve the docs of most Py*_Check{,Exact} API calls (GH-23602)Antonio Cuni2021-01-061-2/+2
| | | | | I think that none of these API calls can fail, but only few of them are documented as such. Add the sentence "This function always succeeds" (which is the same already used e.g. by PyNumber_Check) to all of them.
* bpo-42236: Enhance init and encoding documentation (GH-23109)Victor Stinner2020-11-021-6/+5
| | | | | | | | | | | | | | | | | | | | | Enhance the documentation of the Python startup, filesystem encoding and error handling, locale encoding. Add a new "Python UTF-8 Mode" section. * Add "locale encoding" and "filesystem encoding and error handler" to the glossary * Remove documentation from Include/cpython/initconfig.h: move it to Doc/c-api/init_config.rst. * Doc/c-api/init_config.rst: * Document command line options and environment variables * Document default values. * Add a new "Python UTF-8 Mode" section in Doc/library/os.rst. * Add warnings to Py_DecodeLocale() and Py_EncodeLocale() docs. * Document how Python selects the filesystem encoding and error handler at a single place: PyConfig.filesystem_encoding and PyConfig.filesystem_errors. * PyConfig: move orig_argv member at the right place.
* bpo-41784: make PyUnicode_AsUTF8AndSize part of the limited API (GH-22252)Alex Gaynor2020-10-191-0/+3
|
* bpo-40204, doc: Fix syntax of C variables (GH-21846)Victor Stinner2020-08-131-1/+1
| | | | | | | | | | | | | | | For example, fix the following Sphinx 3 errors: Doc/c-api/buffer.rst:102: WARNING: Error in declarator or parameters Invalid C declaration: Expected identifier in nested name. [error at 5] void \*obj -----^ Doc/c-api/arg.rst:130: WARNING: Unparseable C cross-reference: 'PyObject*' Invalid C declaration: Expected end of definition. [error at 8] PyObject* --------^ The modified documentation is compatible with Sphinx 2 and Sphinx 3.
* bpo-40204: Fix duplicates in the documentation (GH-21857)Victor Stinner2020-08-131-25/+12
| | | | | | | | | Fix two Sphinx 3 issues: Doc/c-api/buffer.rst:304: WARNING: Duplicate C declaration, also defined in 'c-api/buffer'. Declaration is 'PyBUF_ND'. Doc/c-api/unicode.rst:1603: WARNING: Duplicate C declaration, also defined in 'c-api/unicode'. Declaration is 'PyObject* PyUnicode_Translate(PyObject *str, PyObject *table, const char *errors)'.
* bpo-36346: Doc: Update removal schedule of legacy Unicode (GH-21479)Inada Naoki2020-08-051-9/+30
| | | See PEP 623 for detail.
* bpo-41123: Remove PyUnicode_AsUnicodeCopy (GH-21209)Inada Naoki2020-06-301-14/+0
|
* bpo-39500: Document PyUnicode_IsIdentifier() function (GH-18397)Victor Stinner2020-02-111-0/+10
| | | | PyUnicode_IsIdentifier() does not call Py_FatalError() anymore if the string is not ready.
* Correct the documented default encoding (GH-18429)Eric Wieser2020-02-101-1/+1
| | | | | | | | | | | | | From the source for `PyUnicode_Decode`, the implementation is: ``` if (encoding == NULL) { return PyUnicode_DecodeUTF8Stateful(s, size, errors, NULL); } ``` which is pretty clearly not defaulting to ASCII. --- I assume this needs neither a news entry nor bpo link.
* bpo-38896: Remove PyUnicode_ClearFreeList() function (GH-17354)Victor Stinner2019-11-231-5/+0
| | | | Remove PyUnicode_ClearFreeList() function: the Unicode free list has been removed in Python 3.3.
* bpo-38600: NULL -> ``NULL``. (GH-17001)Serhiy Storchaka2019-10-301-4/+4
| | | Also fix some other formatting.
* bpo-38600: Change the mark up of NULL in the C API documentation. (GH-16950)Serhiy Storchaka2019-10-301-155/+155
| | | | Replace all *NULL* with ``NULL``.
* Doc: Replace the deprecated highlightlang directive by highlight. (#13377)Stéphane Wirtel2019-05-171-1/+1
| | | | highlightlang is deprecated since April 2018 in Sphinx. See https://github.com/sphinx-doc/sphinx/pull/4845
* bpo-31873: Update unicode.rst - 'unicode' capitalization (GH-4125)toonarmycaptain2019-05-081-12/+12
| | | | Update 'unicode' capitalization. 'Unicode' is a proper noun, and as such should be capitalized. Changed multiple instances.
* bpo-31904: Add encoding support for VxWorks RTOS (GH-12051)pxinwr2019-03-041-4/+4
| | | | | | | | Use UTF-8 as the system encoding on VxWorks. The main reason are: 1. The locale is frequently misconfigured. 2. Missing some functions to deal with locale in VxWorks C library.
* Fix documented signatures for C API functions. (GH-11236)Serhiy Storchaka2018-12-191-4/+4
|
* Revert "bpo-34595: Add %T format to PyUnicode_FromFormatV() (GH-9080)" (GH-9187)Victor Stinner2018-09-111-6/+0
| | | This reverts commit 886483e2b9bbabf60ab769683269b873381dd5ee.
* bpo-34595: Add %T format to PyUnicode_FromFormatV() (GH-9080)Victor Stinner2018-09-071-0/+6
| | | | | | | | | * Add %T format to PyUnicode_FromFormatV(), and so to PyUnicode_FromFormat() and PyErr_Format(), to format an object type name: equivalent to "%s" with Py_TYPE(obj)->tp_name. * Replace Py_TYPE(obj)->tp_name with %T format in unicodeobject.c. * Add unit test on %T format. * Rename unicode_fromformat_write_cstr() to unicode_fromformat_write_utf8(), to make the intent more explicit.
* bpo-29240: PyUnicode_DecodeLocale() uses UTF-8 on Android (#5272)Victor Stinner2018-01-221-4/+7
| | | | | | | | PyUnicode_DecodeLocaleAndSize(), PyUnicode_DecodeLocale() and PyUnicode_EncodeLocale() now use always use the UTF-8 encoding on Android, instead of the current locale encoding. On Android API 19, mbstowcs() and wcstombs() are broken and cannot be used.
* bpo-29240: Fix locale encodings in UTF-8 Mode (#5170)Victor Stinner2018-01-151-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | Modify locale.localeconv(), time.tzname, os.strerror() and other functions to ignore the UTF-8 Mode: always use the current locale encoding. Changes: * Add _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx(). On decoding or encoding error, they return the position of the error and an error message which are used to raise Unicode errors in PyUnicode_DecodeLocale() and PyUnicode_EncodeLocale(). * Replace _Py_DecodeCurrentLocale() with _Py_DecodeLocaleEx(). * PyUnicode_DecodeLocale() now uses _Py_DecodeLocaleEx() for all cases, especially for the strict error handler. * Add _Py_DecodeUTF8Ex(): return more information on decoding error and supports the strict error handler. * Rename _Py_EncodeUTF8_surrogateescape() to _Py_EncodeUTF8Ex(). * Replace _Py_EncodeCurrentLocale() with _Py_EncodeLocaleEx(). * Ignore the UTF-8 mode to encode/decode localeconv(), strerror() and time zone name. * Remove PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize() and PyUnicode_EncodeLocale() now ignore the UTF-8 mode: always use the "current" locale. * Remove _PyUnicode_DecodeCurrentLocale(), _PyUnicode_DecodeCurrentLocaleAndSize() and _PyUnicode_EncodeCurrentLocale().
* bpo-30708: Check for null characters in PyUnicode_AsWideCharString(). (#2285)Serhiy Storchaka2017-06-271-5/+11
| | | | | Raise a ValueError if the second argument is NULL and the wchar_t\* string contains null characters.
* bpo-28415: Note 0 conversion different between Python and C (#885)Louie Lu2017-04-271-26/+29
|
* bpo-29918: Add missed "const" modifiers in C API documentation. (#846)Serhiy Storchaka2017-03-301-4/+4
|
* bpo-28749: Fixed the documentation of the mapping codec APIs. (#487)Serhiy Storchaka2017-03-191-47/+48
| | | Added the documentation for PyUnicode_Translate().
* Issue #28769: The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8()Serhiy Storchaka2017-01-221-2/+8
| | | | is now of type "const char *" rather of "char *".
* Issue #29087: Removed the documentation of non-existing UCS4 support functions.Serhiy Storchaka2016-12-281-20/+0
|\
| * Issue #29087: Removed the documentation of non-existing UCS4 support functions.Serhiy Storchaka2016-12-281-20/+0
| |\
| | * Issue #29087: Removed the documentation of non-existing UCS4 support functions.Serhiy Storchaka2016-12-281-20/+0
| | |