summaryrefslogtreecommitdiffstats
path: root/sip/qt
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-01-04 11:15:00 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-01-04 16:37:05 +0900
commitd31a084fc83d47eef6c6eb3aac76989da9692853 (patch)
tree2a412325bd788cd505bb5cdad90ac498a004e405 /sip/qt
parent30954661009ddfb9db2e9daed3bfbd594bb20441 (diff)
downloadpytqt-d31a084fc83d47eef6c6eb3aac76989da9692853.tar.gz
pytqt-d31a084fc83d47eef6c6eb3aac76989da9692853.zip
Use utf8 instead of latin1/ascii as default. Address pyuic compatibility with python3.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'sip/qt')
-rw-r--r--sip/qt/qapplication.sip2
-rw-r--r--sip/qt/qimage.sip6
-rw-r--r--sip/qt/qobject.sip8
-rw-r--r--sip/qt/qstring.sip2
-rw-r--r--sip/qt/qstrlist.sip2
5 files changed, 10 insertions, 10 deletions
diff --git a/sip/qt/qapplication.sip b/sip/qt/qapplication.sip
index dcf333d..d9247d9 100644
--- a/sip/qt/qapplication.sip
+++ b/sip/qt/qapplication.sip
@@ -374,7 +374,7 @@ static char **pyArgvToC(PyObject *argvlist,int &argc)
if (PyUnicode_Check(argObject))
{
- arg = tqstrdup(sipString_AsLatin1String(&argObject));
+ arg = tqstrdup(sipString_AsUTF8String(&argObject));
}
else if (SIPBytes_Check(argObject))
{
diff --git a/sip/qt/qimage.sip b/sip/qt/qimage.sip
index b1628c5..9fb7907 100644
--- a/sip/qt/qimage.sip
+++ b/sip/qt/qimage.sip
@@ -432,15 +432,15 @@ const char **PyTQt_qt_ListToArray(PyObject *lst)
for (int i = 0; i < nstr; ++i)
{
PyObject *item = PyList_GetItem(lst, i);
- const char *item_ascii = sipString_AsASCIIString(&item);
+ const char *item_utf8 = sipString_AsUTF8String(&item);
- if (item_ascii == NULL)
+ if (item_utf8 == NULL)
{
sipFree((void *)str);
return NULL;
}
- *sp++ = item_ascii;
+ *sp++ = item_utf8;
}
return str;
diff --git a/sip/qt/qobject.sip b/sip/qt/qobject.sip
index df82e56..b6e0387 100644
--- a/sip/qt/qobject.sip
+++ b/sip/qt/qobject.sip
@@ -369,11 +369,11 @@ public:
}
else
{
- const char *source = sipString_AsLatin1String(&a0);
+ const char *source = sipString_AsUTF8String(&a0);
if (source)
{
- sipRes = new TQString(QString::fromLatin1(source));
+ sipRes = new TQString(QString::fromUtf8(source));
Py_DECREF(a0);
}
else
@@ -402,11 +402,11 @@ public:
}
else
{
- const char *source = sipString_AsLatin1String(&a0);
+ const char *source = sipString_AsUTF8String(&a0);
if (source)
{
- sipRes = new TQString(TQString::fromLatin1(source));
+ sipRes = new TQString(TQString::fromUtf8(source));
Py_DECREF(a0);
}
else
diff --git a/sip/qt/qstring.sip b/sip/qt/qstring.sip
index 13bf0a1..d06fec1 100644
--- a/sip/qt/qstring.sip
+++ b/sip/qt/qstring.sip
@@ -831,7 +831,7 @@ TQString *PyTQt_qt_PyObject_AsTQString(PyObject *obj)
switch (PyUnicode_KIND(obj))
{
case PyUnicode_1BYTE_KIND:
- return new TQString(TQString::fromLatin1((char *)PyUnicode_1BYTE_DATA(obj), len));
+ return new TQString(TQString::fromUtf8((char *)PyUnicode_1BYTE_DATA(obj), len));
case PyUnicode_2BYTE_KIND:
// The (TQChar *) cast should be safe.
diff --git a/sip/qt/qstrlist.sip b/sip/qt/qstrlist.sip
index 695c872..2a35b65 100644
--- a/sip/qt/qstrlist.sip
+++ b/sip/qt/qstrlist.sip
@@ -85,7 +85,7 @@ is used instead.
if (PyUnicode_Check(object))
{
- s = tqstrdup(sipString_AsLatin1String(&object));
+ s = tqstrdup(sipString_AsUTF8String(&object));
}
else if ((s = (char *)sipBytes_AsString(object)) == NULL)
{