summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-06-27 06:28:56 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-06-27 06:28:56 (GMT)
commitce9b5a55e164f1128756478b6a2bb548abec1980 (patch)
tree0b616e0fae5ec7204f723235d196ae2b7c124d78 /Python
parent236d8b79748fec890d57ad0dd99ea3f1c3ba57df (diff)
downloadcpython-ce9b5a55e164f1128756478b6a2bb548abec1980.zip
cpython-ce9b5a55e164f1128756478b6a2bb548abec1980.tar.gz
cpython-ce9b5a55e164f1128756478b6a2bb548abec1980.tar.bz2
Encode surrogates in UTF-8 even for a wide Py_UNICODE.
Implement sys.maxunicode. Explicitly wrap around upper/lower computations for wide Py_UNICODE. When decoding large characters with UTF-8, represent expected test results using the \U notation.
Diffstat (limited to 'Python')
-rw-r--r--Python/sysmodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 62e0841..fe880d5 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -533,6 +533,7 @@ exc_traceback -- traceback of exception currently being handled\n\
Static objects:\n\
\n\
maxint -- the largest supported integer (the smallest is -maxint-1)\n\
+maxunicode -- the largest supported character\n\
builtin_module_names -- tuple of module names built into this intepreter\n\
version -- the version of this interpreter as a string\n\
version_info -- version information as a tuple\n\
@@ -643,6 +644,9 @@ _PySys_Init(void)
PyDict_SetItemString(sysdict, "maxint",
v = PyInt_FromLong(PyInt_GetMax()));
Py_XDECREF(v);
+ PyDict_SetItemString(sysdict, "maxunicode",
+ v = PyInt_FromLong(PyUnicode_GetMax()));
+ Py_XDECREF(v);
PyDict_SetItemString(sysdict, "builtin_module_names",
v = list_builtin_module_names());
Py_XDECREF(v);