summaryrefslogtreecommitdiffstats
path: root/Include/unicodeobject.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-12-17 03:13:41 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-12-17 03:13:41 (GMT)
commitf2ea71fcc8986101512265b685d8d3dfdf7b7bdb (patch)
tree6b5e8c37d0b73993e542181584f0af7b87482220 /Include/unicodeobject.h
parent9987d9351ca06dbad3b66ab6da52ab4621955f31 (diff)
downloadcpython-f2ea71fcc8986101512265b685d8d3dfdf7b7bdb.zip
cpython-f2ea71fcc8986101512265b685d8d3dfdf7b7bdb.tar.gz
cpython-f2ea71fcc8986101512265b685d8d3dfdf7b7bdb.tar.bz2
Issue #13560: Add PyUnicode_EncodeLocale()
* Use PyUnicode_EncodeLocale() in time.strftime() if wcsftime() is not available * Document my last changes in Misc/NEWS
Diffstat (limited to 'Include/unicodeobject.h')
-rw-r--r--Include/unicodeobject.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 5f073e0..8a23c7d 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -1603,7 +1603,7 @@ PyAPI_FUNC(PyObject*) _PyUnicode_TransformDecimalAndSpaceToASCII(
be decoded as a surrogate character and *surrogateescape* is not equal to
zero, the byte sequence is escaped using the 'surrogateescape' error handler
instead of being decoded. *str* must end with a null character but cannot
- contain embedded null character. */
+ contain embedded null characters. */
PyAPI_FUNC(PyObject*) PyUnicode_DecodeLocaleAndSize(
const char *str,
@@ -1617,6 +1617,16 @@ PyAPI_FUNC(PyObject*) PyUnicode_DecodeLocale(
const char *str,
int surrogateescape);
+/* Encode a Unicode object to the current locale encoding. The encoder is
+ strict is *surrogateescape* is equal to zero, otherwise the
+ "surrogateescape" error handler is used. Return a bytes object. The string
+ cannot contain embedded null characters.. */
+
+PyAPI_FUNC(PyObject*) PyUnicode_EncodeLocale(
+ PyObject *unicode,
+ int surrogateescape
+ );
+
/* --- File system encoding ---------------------------------------------- */
/* ParseTuple converter: encode str objects to bytes using