@@ -853,19 +853,25 @@ public static extern int Py_Main(
853
853
internal static extern IntPtr Py_GetBuildInfo( ) ;
854
854
855
855
[ DllImport ( _PythonDll , CallingConvention = CallingConvention . Cdecl ) ]
856
- internal static extern int PyRun_SimpleString ( string code ) ;
856
+ internal static extern int PyRun_SimpleString (
857
+ [ MarshalAs ( UnmanagedType . CustomMarshaler , MarshalTypeRef = typeof ( Utf8Marshaler ) ) ] string code ) ;
857
858
858
859
[ DllImport ( _PythonDll , CallingConvention = CallingConvention . Cdecl ) ]
859
- internal static extern IntPtr PyRun_String( string code , IntPtr st , IntPtr globals , IntPtr locals ) ;
860
+ internal static extern IntPtr PyRun_String(
861
+ [ MarshalAs ( UnmanagedType . CustomMarshaler , MarshalTypeRef = typeof ( Utf8Marshaler ) ) ] string code ,
862
+ IntPtr st , IntPtr globals , IntPtr locals ) ;
860
863
861
864
[ DllImport ( _PythonDll , CallingConvention = CallingConvention . Cdecl ) ]
862
865
internal static extern IntPtr PyEval_EvalCode( IntPtr co , IntPtr globals , IntPtr locals ) ;
863
866
864
867
[ DllImport ( _PythonDll , CallingConvention = CallingConvention . Cdecl ) ]
865
- internal static extern IntPtr Py_CompileString( string code , string file , IntPtr tok ) ;
868
+ internal static extern IntPtr Py_CompileString(
869
+ [ MarshalAs ( UnmanagedType . CustomMarshaler , MarshalTypeRef = typeof ( Utf8Marshaler ) ) ] string code ,
870
+ [ MarshalAs ( UnmanagedType . CustomMarshaler , MarshalTypeRef = typeof ( Utf8Marshaler ) ) ] string file , IntPtr tok ) ;
866
871
867
872
[ DllImport ( _PythonDll , CallingConvention = CallingConvention . Cdecl ) ]
868
- internal static extern IntPtr PyImport_ExecCodeModule( string name , IntPtr code ) ;
873
+ internal static extern IntPtr PyImport_ExecCodeModule(
874
+ [ MarshalAs ( UnmanagedType . CustomMarshaler , MarshalTypeRef = typeof ( Utf8Marshaler ) ) ] string name , IntPtr code ) ;
869
875
870
876
[ DllImport ( _PythonDll , CallingConvention = CallingConvention . Cdecl ) ]
871
877
internal static extern IntPtr PyCFunction_NewEx( IntPtr ml , IntPtr self , IntPtr mod ) ;
0 commit comments