summaryrefslogtreecommitdiffstats
path: root/Modules/unicodedata.c
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-06-05 16:04:09 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-06-05 16:04:09 (GMT)
commit4254e76319c03ea6c41ee0779cb7e6075b0d106c (patch)
treeb31c455ca99c544add41907d1bffdec509e4701c /Modules/unicodedata.c
parent0bbd8abe6b890e296141a4311b361f81af2e4b2c (diff)
downloadcpython-4254e76319c03ea6c41ee0779cb7e6075b0d106c.zip
cpython-4254e76319c03ea6c41ee0779cb7e6075b0d106c.tar.gz
cpython-4254e76319c03ea6c41ee0779cb7e6075b0d106c.tar.bz2
Change category(), bidirectional(), east_asian_width(),
decomposition() and name() to return unicode strings.
Diffstat (limited to 'Modules/unicodedata.c')
-rw-r--r--Modules/unicodedata.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c
index a30d30c..da8af34 100644
--- a/Modules/unicodedata.c
+++ b/Modules/unicodedata.c
@@ -258,7 +258,7 @@ unicodedata_category(PyObject *self, PyObject *args)
if (old->category_changed != 0xFF)
index = old->category_changed;
}
- return PyString_FromString(_PyUnicode_CategoryNames[index]);
+ return PyUnicode_FromString(_PyUnicode_CategoryNames[index]);
}
PyDoc_STRVAR(unicodedata_bidirectional__doc__,
@@ -290,7 +290,7 @@ unicodedata_bidirectional(PyObject *self, PyObject *args)
else if (old->bidir_changed != 0xFF)
index = old->bidir_changed;
}
- return PyString_FromString(_PyUnicode_BidirectionalNames[index]);
+ return PyUnicode_FromString(_PyUnicode_BidirectionalNames[index]);
}
PyDoc_STRVAR(unicodedata_combining__doc__,
@@ -379,7 +379,7 @@ unicodedata_east_asian_width(PyObject *self, PyObject *args)
if (old->category_changed == 0)
index = 0; /* unassigned */
}
- return PyString_FromString(_PyUnicode_EastAsianWidthNames[index]);
+ return PyUnicode_FromString(_PyUnicode_EastAsianWidthNames[index]);
}
PyDoc_STRVAR(unicodedata_decomposition__doc__,
@@ -411,7 +411,7 @@ unicodedata_decomposition(PyObject *self, PyObject *args)
if (self) {
const change_record *old = get_old_record(self, *PyUnicode_AS_UNICODE(v));
if (old->category_changed == 0)
- return PyString_FromString(""); /* unassigned */
+ return PyUnicode_FromString(""); /* unassigned */
}
if (code < 0 || code >= 0x110000)
@@ -450,7 +450,7 @@ unicodedata_decomposition(PyObject *self, PyObject *args)
decomp[i] = '\0';
- return PyString_FromString(decomp);
+ return PyUnicode_FromString(decomp);
}
static void
@@ -1063,7 +1063,7 @@ unicodedata_name(PyObject* self, PyObject* args)
}
}
- return Py_BuildValue("s", name);
+ return PyUnicode_FromString(name);
}
PyDoc_STRVAR(unicodedata_lookup__doc__,