diff --git a/src/CXX/Python3/Objects.hxx b/src/CXX/Python3/Objects.hxx index dd4b46c779..5d15b4b2de 100644 --- a/src/CXX/Python3/Objects.hxx +++ b/src/CXX/Python3/Objects.hxx @@ -1975,7 +1975,7 @@ namespace Py } Char( const unicodestring &v ) - : Object( PyUnicode_FromUnicode( const_cast( v.data() ),1 ), true ) + : Object( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, const_cast( v.data() ),1 ), true ) { validate(); } @@ -1995,20 +1995,20 @@ namespace Py Char &operator=( const unicodestring &v ) { - set( PyUnicode_FromUnicode( const_cast( v.data() ), 1 ), true ); + set( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, const_cast( v.data() ), 1 ), true ); return *this; } Char &operator=( int v_ ) { Py_UNICODE v( v_ ); - set( PyUnicode_FromUnicode( &v, 1 ), true ); + set( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, &v, 1 ), true ); return *this; } Char &operator=( Py_UNICODE v ) { - set( PyUnicode_FromUnicode( &v, 1 ), true ); + set( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, &v, 1 ), true ); return *this; } @@ -2102,7 +2102,7 @@ namespace Py } String( const Py_UNICODE *s, int length ) - : SeqBase( PyUnicode_FromUnicode( s, length ), true ) + : SeqBase( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, s, length ), true ) { validate(); } @@ -2122,7 +2122,7 @@ namespace Py String &operator=( const unicodestring &v ) { - set( PyUnicode_FromUnicode( const_cast( v.data() ), v.length() ), true ); + set( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, const_cast( v.data() ), v.length() ), true ); return *this; }