diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-10-09 10:34:37 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-10-09 10:34:37 (GMT) |
commit | 62165d67a25229fee85c98cef9d1feaf109b1339 (patch) | |
tree | 77193a4f306941b520b8aa5c5eed8611c00fa1a7 /Doc/c-api | |
parent | 257d38ffdd5e85c17e14d63e1930e4756864878f (diff) | |
download | cpython-62165d67a25229fee85c98cef9d1feaf109b1339.zip cpython-62165d67a25229fee85c98cef9d1feaf109b1339.tar.gz cpython-62165d67a25229fee85c98cef9d1feaf109b1339.tar.bz2 |
Document that the 'strict' error handler is used to encode/decode filenames on
Windows
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/unicode.rst | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index 8f9e994..dac01a4 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -412,26 +412,33 @@ used, passing :c:func:`PyUnicode_FSDecoder` as the conversion function: .. c:function:: PyObject* PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size) - Decode a null-terminated string using :c:data:`Py_FileSystemDefaultEncoding` - and the ``"surrogateescape"`` error handler. + Decode a string using :c:data:`Py_FileSystemDefaultEncoding` and the + ``'surrogateescape'`` error handler, or ``'strict'`` on Windows. If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to UTF-8. - Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` if you know the string length. + .. versionchanged:: 3.2 + Use ``'strict'`` error handler on Windows. .. c:function:: PyObject* PyUnicode_DecodeFSDefault(const char *s) - Decode a string using :c:data:`Py_FileSystemDefaultEncoding` and - the ``"surrogateescape"`` error handler. + Decode a null-terminated string using :c:data:`Py_FileSystemDefaultEncoding` + and the ``'surrogateescape'`` error handler, or ``'strict'`` on Windows. If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to UTF-8. + Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` if you know the string length. + + .. versionchanged:: 3.2 + Use ``'strict'`` error handler on Windows. + .. c:function:: PyObject* PyUnicode_EncodeFSDefault(PyObject *unicode) Encode a Unicode object to :c:data:`Py_FileSystemDefaultEncoding` with the - ``'surrogateescape'`` error handler, and return :class:`bytes`. + ``'surrogateescape'`` error handler, or ``'strict'`` on Windows, and return + :class:`bytes`. If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to UTF-8. |