diff -bur FreeCAD-1.0.0-orig/src/CXX/Python3/Objects.hxx FreeCAD-1.0.0/src/CXX/Python3/Objects.hxx
--- FreeCAD-1.0.0-orig/src/CXX/Python3/Objects.hxx	2024-11-19 22:18:28.079768600 -0700
+++ FreeCAD-1.0.0/src/CXX/Python3/Objects.hxx	2024-11-19 22:18:35.887080300 -0700
@@ -1787,7 +1787,7 @@
     typedef std::basic_string<Py_UNICODE> unicodestring;
     extern Py_UNICODE unicode_null_string[1];
 #endif
-    typedef std::basic_string<Py_UCS4> ucs4string;
+    typedef std::basic_string<char32_t> ucs4string;
     extern Py_UCS4 ucs4_null_string[1];
 
     class PYCXX_EXPORT Byte: public Object
@@ -2237,7 +2237,7 @@
             {
                 ifPyErrorThrowCxxException();
             }
-            ucs4string ucs4( buf, size() );
+            ucs4string ucs4( reinterpret_cast<const char32_t*>(buf), size() );
             delete[] buf;
 
             return ucs4;
