diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-11-22 02:27:30 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-11-22 02:27:30 +0100 |
commit | 05407577effc3f36d9b63c12b8e754eb86e8e3f6 (patch) | |
tree | e9a12684808169de00a2f385b750117ff72fa88d /PC/_msi.c | |
parent | d1bc252166f9ed44c6148cd2d5801f069fce4f6c (diff) | |
download | cpython-05407577effc3f36d9b63c12b8e754eb86e8e3f6.tar.gz |
Use the new Unicode API
* Replace PyUnicode_FromUnicode(NULL, 0) by PyUnicode_New(0, 0)
* Replce PyUnicode_FromUnicode(str, len) by PyUnicode_FromWideChar(str, len)
* Replace Py_UNICODE by wchar_t
* posix_putenv() uses PyUnicode_FromFormat() to create the string, instead
of PyUnicode_FromUnicode() + _snwprintf()
Diffstat (limited to 'PC/_msi.c')
-rw-r--r-- | PC/_msi.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -18,7 +18,7 @@ static PyObject* uuidcreate(PyObject* obj, PyObject*args) { UUID result; - unsigned short *cresult; + wchar_t *cresult; PyObject *oresult; /* May return ok, local only, and no address. @@ -35,7 +35,7 @@ uuidcreate(PyObject* obj, PyObject*args) return NULL; } - oresult = PyUnicode_FromUnicode(cresult, wcslen(cresult)); + oresult = PyUnicode_FromWideChar(cresult, wcslen(cresult)); RpcStringFreeW(&cresult); return oresult; @@ -379,7 +379,7 @@ record_getstring(msiobj* record, PyObject* args) } if (status != ERROR_SUCCESS) return msierror((int) status); - string = PyUnicode_FromUnicode(res, size); + string = PyUnicode_FromWideChar(res, size); if (buf != res) free(res); return string; @@ -401,7 +401,7 @@ record_setstring(msiobj* record, PyObject *args) { int status; int field; - Py_UNICODE *data; + wchar_t *data; if (!PyArg_ParseTuple(args, "iu:SetString", &field, &data)) return NULL; @@ -418,7 +418,7 @@ record_setstream(msiobj* record, PyObject *args) { int status; int field; - Py_UNICODE *data; + wchar_t *data; if (!PyArg_ParseTuple(args, "iu:SetStream", &field, &data)) return NULL; |