@@ -204,7 +204,7 @@ public IDbStatement Prepare2(IDbHandle db, string query)
204204 {
205205 var dbHandle = ( DbHandle ) db ;
206206 var stmt = default ( Sqlite3Statement ) ;
207- var r = SQLite3 . Prepare2 ( dbHandle . InternalDbHandle , query , query . Length , out stmt , IntPtr . Zero ) ;
207+ var r = SQLite3 . Prepare2 ( dbHandle . InternalDbHandle , query , - 1 , out stmt , IntPtr . Zero ) ;
208208 if ( r != Result . OK )
209209 {
210210 throw SQLiteException . New ( r , SQLite3 . GetErrmsg ( dbHandle . InternalDbHandle ) ) ;
@@ -355,8 +355,8 @@ public static class SQLite3
355355 [ DllImport ( "sqlite3" , EntryPoint = "sqlite3_changes" , CallingConvention = CallingConvention . Cdecl ) ]
356356 public static extern int Changes ( IntPtr db ) ;
357357
358- [ DllImport ( "sqlite3" , EntryPoint = "sqlite3_prepare_v2 " , CallingConvention = CallingConvention . Cdecl ) ]
359- public static extern Result Prepare2 ( IntPtr db , [ MarshalAs ( UnmanagedType . LPStr ) ] string sql , int numBytes , out IntPtr stmt , IntPtr pzTail ) ;
358+ [ DllImport ( "sqlite3" , EntryPoint = "sqlite3_prepare16_v2 " , CallingConvention = CallingConvention . Cdecl ) ]
359+ public static extern Result Prepare2 ( IntPtr db , [ MarshalAs ( UnmanagedType . LPWStr ) ] string sql , int numBytes , out IntPtr stmt , IntPtr pzTail ) ;
360360
361361 [ DllImport ( "sqlite3" , EntryPoint = "sqlite3_step" , CallingConvention = CallingConvention . Cdecl ) ]
362362 public static extern Result Step ( IntPtr stmt ) ;
0 commit comments