@@ -1192,7 +1192,7 @@ static int ue_PyUObject_setattro(ue_PyUObject *self, PyObject *attr_name, PyObje
11921192 // first of all check for UProperty
11931193 if (PyUnicodeOrString_Check (attr_name))
11941194 {
1195- char *attr = ( char *) PyUnicode_AsUTF8 (attr_name);
1195+ const char *attr = UEPyUnicode_AsUTF8 (attr_name);
11961196 // first check for property
11971197 UStruct *u_struct = nullptr ;
11981198 if (self->ue_object ->IsA <UStruct>())
@@ -1792,13 +1792,13 @@ void unreal_engine_py_log_error()
17921792 PyObject *item = PyList_GetItem (ret, i);
17931793 if (item)
17941794 {
1795- UE_LOG (LogPython, Error, TEXT (" %s" ), UTF8_TO_TCHAR (PyUnicode_AsUTF8 (PyObject_Str (item))));
1795+ UE_LOG (LogPython, Error, TEXT (" %s" ), UTF8_TO_TCHAR (UEPyUnicode_AsUTF8 (PyObject_Str (item))));
17961796 }
17971797 }
17981798 }
17991799 else
18001800 {
1801- UE_LOG (LogPython, Error, TEXT (" %s" ), UTF8_TO_TCHAR (PyUnicode_AsUTF8 (PyObject_Str (ret))));
1801+ UE_LOG (LogPython, Error, TEXT (" %s" ), UTF8_TO_TCHAR (UEPyUnicode_AsUTF8 (PyObject_Str (ret))));
18021802 }
18031803 }
18041804
@@ -2158,17 +2158,17 @@ bool ue_py_convert_pyobject(PyObject *py_obj, UProperty *prop, uint8 *buffer, in
21582158 {
21592159 if (auto casted_prop = Cast<UStrProperty>(prop))
21602160 {
2161- casted_prop->SetPropertyValue_InContainer (buffer, UTF8_TO_TCHAR (PyUnicode_AsUTF8 (py_obj)), index);
2161+ casted_prop->SetPropertyValue_InContainer (buffer, UTF8_TO_TCHAR (UEPyUnicode_AsUTF8 (py_obj)), index);
21622162 return true ;
21632163 }
21642164 if (auto casted_prop = Cast<UNameProperty>(prop))
21652165 {
2166- casted_prop->SetPropertyValue_InContainer (buffer, UTF8_TO_TCHAR (PyUnicode_AsUTF8 (py_obj)), index);
2166+ casted_prop->SetPropertyValue_InContainer (buffer, UTF8_TO_TCHAR (UEPyUnicode_AsUTF8 (py_obj)), index);
21672167 return true ;
21682168 }
21692169 if (auto casted_prop = Cast<UTextProperty>(prop))
21702170 {
2171- casted_prop->SetPropertyValue_InContainer (buffer, FText::FromString (UTF8_TO_TCHAR (PyUnicode_AsUTF8 (py_obj))), index);
2171+ casted_prop->SetPropertyValue_InContainer (buffer, FText::FromString (UTF8_TO_TCHAR (UEPyUnicode_AsUTF8 (py_obj))), index);
21722172 return true ;
21732173 }
21742174 return false ;
@@ -2574,7 +2574,7 @@ void ue_bind_events_for_py_class_by_attribute(UObject *u_obj, PyObject *py_class
25742574 PyObject *py_attr_name = PyList_GetItem (attrs, i);
25752575 if (!py_attr_name || !PyUnicodeOrString_Check (py_attr_name))
25762576 continue ;
2577- PyObject *item = PyObject_GetAttrString (py_class, PyUnicode_AsUTF8 (py_attr_name));
2577+ PyObject *item = PyObject_GetAttrString (py_class, UEPyUnicode_AsUTF8 (py_attr_name));
25782578 if (item && PyCallable_Check (item))
25792579 {
25802580 // check for ue_event signature
@@ -2583,7 +2583,7 @@ void ue_bind_events_for_py_class_by_attribute(UObject *u_obj, PyObject *py_class
25832583 {
25842584 if (PyUnicode_Check (event_signature))
25852585 {
2586- FString event_name = FString (UTF8_TO_TCHAR (PyUnicode_AsUTF8 (event_signature)));
2586+ FString event_name = FString (UTF8_TO_TCHAR (UEPyUnicode_AsUTF8 (event_signature)));
25872587 TArray<FString> parts;
25882588 int n = event_name.ParseIntoArray (parts, UTF8_TO_TCHAR (" ." ));
25892589 if (n < 1 || n > 2 )
@@ -2652,7 +2652,7 @@ void ue_autobind_events_for_pyclass(ue_PyUObject *u_obj, PyObject *py_class)
26522652 PyObject *py_attr_name = PyList_GetItem (attrs, i);
26532653 if (!py_attr_name || !PyUnicodeOrString_Check (py_attr_name))
26542654 continue ;
2655- FString attr_name = UTF8_TO_TCHAR (PyUnicode_AsUTF8 (py_attr_name));
2655+ FString attr_name = UTF8_TO_TCHAR (UEPyUnicode_AsUTF8 (py_attr_name));
26562656 if (!attr_name.StartsWith (" on_" , ESearchCase::CaseSensitive))
26572657 continue ;
26582658 // check if the attr is a callable
0 commit comments