summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-05-15 16:27:27 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-05-15 16:27:27 (GMT)
commitae6265f8d06dbec7d08c73ca23dad0f040d09b8e (patch)
tree3598426233e690b284bce322194f51be94ab6799 /Doc/c-api
parent59e62db0a39eb89930ed3ae1730726cd15b7d640 (diff)
downloadcpython-ae6265f8d06dbec7d08c73ca23dad0f040d09b8e.zip
cpython-ae6265f8d06dbec7d08c73ca23dad0f040d09b8e.tar.gz
cpython-ae6265f8d06dbec7d08c73ca23dad0f040d09b8e.tar.bz2
Issue #8715: Create PyUnicode_EncodeFSDefault() function: Encode a Unicode
object to Py_FileSystemDefaultEncoding with the "surrogateescape" error handler, return a bytes object. If Py_FileSystemDefaultEncoding is not set, fall back to UTF-8.
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/unicode.rst11
1 files changed, 11 insertions, 0 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index 6e163d6..4222a05 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -396,6 +396,7 @@ used, passsing :func:PyUnicode_FSConverter as the conversion function:
Use :func:`PyUnicode_DecodeFSDefaultAndSize` if you know the string length.
+
.. cfunction:: PyObject* PyUnicode_DecodeFSDefault(const char *s)
Decode a string using :cdata:`Py_FileSystemDefaultEncoding` and
@@ -404,6 +405,16 @@ used, passsing :func:PyUnicode_FSConverter as the conversion function:
If :cdata:`Py_FileSystemDefaultEncoding` is not set, fall back to UTF-8.
+.. cfunction:: PyObject* PyUnicode_EncodeFSDefault(PyObject *unicode)
+
+ Encode a Unicode object to :cdata:`Py_FileSystemDefaultEncoding` with the
+ ``'surrogateescape'`` error handler, return a :func:`bytes` object.
+
+ If :cdata:`Py_FileSystemDefaultEncoding` is not set, fall back to UTF-8.
+
+ .. versionadded:: 3.2
+
+
wchar_t Support
"""""""""""""""