summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2004-04-06 07:24:51 (GMT)
committerHye-Shik Chang <hyeshik@gmail.com>2004-04-06 07:24:51 (GMT)
commit4057483164f96195bf7482e0bf188028f74fcd44 (patch)
tree5aeb0ee4029c272f0d7b320cb43a61c53d16a4ca /Objects/unicodeobject.c
parent8a5c3c76be10945ce62b055bc6823013b880330f (diff)
downloadcpython-4057483164f96195bf7482e0bf188028f74fcd44.zip
cpython-4057483164f96195bf7482e0bf188028f74fcd44.tar.gz
cpython-4057483164f96195bf7482e0bf188028f74fcd44.tar.bz2
SF Patch #926375: Remove a useless UTF-16 support code that is never
been used. (Suggested by Martin v. Loewis)
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index e3bef57..ada01fc 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -405,7 +405,7 @@ int PyUnicode_AsWideChar(PyUnicodeObject *unicode,
PyObject *PyUnicode_FromOrdinal(int ordinal)
{
- Py_UNICODE s[2];
+ Py_UNICODE s[1];
#ifdef Py_UNICODE_WIDE
if (ordinal < 0 || ordinal > 0x10ffff) {
@@ -423,23 +423,8 @@ PyObject *PyUnicode_FromOrdinal(int ordinal)
}
#endif
- if (ordinal <= 0xffff) {
- /* UCS-2 character */
- s[0] = (Py_UNICODE) ordinal;
- return PyUnicode_FromUnicode(s, 1);
- }
- else {
-#ifndef Py_UNICODE_WIDE
- /* UCS-4 character. store as two surrogate characters */
- ordinal -= 0x10000L;
- s[0] = 0xD800 + (Py_UNICODE) (ordinal >> 10);
- s[1] = 0xDC00 + (Py_UNICODE) (ordinal & 0x03FF);
- return PyUnicode_FromUnicode(s, 2);
-#else
- s[0] = (Py_UNICODE)ordinal;
- return PyUnicode_FromUnicode(s, 1);
-#endif
- }
+ s[0] = (Py_UNICODE)ordinal;
+ return PyUnicode_FromUnicode(s, 1);
}
PyObject *PyUnicode_FromObject(register PyObject *obj)