aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/pyside2/PySide2/QtCore/typesystem_core_common.xml7
1 files changed, 2 insertions, 5 deletions
diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
index 488ee068b..d0806a19f 100644
--- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
+++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
@@ -283,11 +283,8 @@
<include file-name="QString" location="global"/>
<conversion-rule>
<native-to-target>
- const int N = %in.length();
- wchar_t *str = new wchar_t[N];
- %in.toWCharArray(str);
- PyObject *%out = PyUnicode_FromWideChar(str, N);
- delete[] str;
+ QByteArray ba = %in.toUtf8();
+ PyObject *%out = PyUnicode_FromStringAndSize(ba.constData(), ba.size());
return %out;
</native-to-target>
<target-to-native>