fix for windows locale setting

This commit is contained in:
Xiao Xiangquan
2011-08-31 07:31:02 +00:00
parent 241dc35f0e
commit 5b91a783cf
2 changed files with 115 additions and 76 deletions

View File

@@ -380,15 +380,9 @@ PyDoc_STRVAR(py_blf_gettext_doc,
static PyObject *py_blf_gettext(PyObject *UNUSED(self), PyObject *args)
{
char* msgid;
char* msgstr;
char* error_handle=NULL;
if (!PyArg_ParseTuple(args, "s:blf.gettext", &msgid))
return NULL;
msgstr = BLF_gettext( msgid );
return PyUnicode_DecodeUTF8( msgstr, strlen(msgstr), error_handle );
return PyUnicode_FromString( BLF_gettext( msgid ) );
}
PyDoc_STRVAR(py_blf_fake_gettext_doc,
@@ -403,13 +397,11 @@ PyDoc_STRVAR(py_blf_fake_gettext_doc,
);
static PyObject *py_blf_fake_gettext(PyObject *UNUSED(self), PyObject *args)
{
char* msgid;
char* error_handle = NULL;
if (!PyArg_ParseTuple(args, "s:blf.gettext", &msgid))
const char* msgid;
if (!PyArg_ParseTuple(args, "s:blf.fake_gettext", &msgid))
return NULL;
return PyUnicode_DecodeUTF8( msgid, strlen(msgid), error_handle );
return PyUnicode_FromString( msgid );
}
/*----------------------------MODULE INIT-------------------------*/