@@ -30,7 +30,7 @@ QgsScopedSqlite::QgsScopedSqlite( const QString& path, bool withExtension )
3030 sqlite3_auto_extension ( reinterpret_cast < void ( * )() > ( qgsvlayerModuleInit ) );
3131 }
3232 int r;
33- r = sqlite3_open ( path.toLocal8Bit ().constData (), &db_ );
33+ r = sqlite3_open ( path.toUtf8 ().constData (), &db_ );
3434 if ( withExtension )
3535 {
3636 // reset the automatic extensions
@@ -41,7 +41,7 @@ QgsScopedSqlite::QgsScopedSqlite( const QString& path, bool withExtension )
4141 {
4242 QString err = QString ( " %1 [%2]" ).arg ( sqlite3_errmsg ( db_ ), path );
4343 QgsDebugMsg ( err );
44- throw std::runtime_error ( err.toLocal8Bit ().constData () );
44+ throw std::runtime_error ( err.toUtf8 ().constData () );
4545 }
4646 // enable extended result codes
4747 sqlite3_extended_result_codes ( db_, 1 );
@@ -91,12 +91,12 @@ namespace Sqlite
9191 : db_( db )
9292 , nBind_( 1 )
9393 {
94- QByteArray ba ( q.toLocal8Bit () );
94+ QByteArray ba ( q.toUtf8 () );
9595 int r = sqlite3_prepare_v2 ( db, ba.constData (), ba.size (), &stmt_, nullptr );
9696 if ( r )
9797 {
9898 QString err = QString ( " Query preparation error on %1: %2" ).arg ( q ).arg ( sqlite3_errmsg ( db ) );
99- throw std::runtime_error ( err.toLocal8Bit ().constData () );
99+ throw std::runtime_error ( err.toUtf8 ().constData () );
100100 }
101101 }
102102
@@ -109,7 +109,7 @@ namespace Sqlite
109109
110110 Query& Query::bind ( const QString& str, int idx )
111111 {
112- QByteArray ba ( str.toLocal8Bit () );
112+ QByteArray ba ( str.toUtf8 () );
113113 int r = sqlite3_bind_text ( stmt_, idx, ba.constData (), ba.size (), SQLITE_TRANSIENT );
114114 if ( r )
115115 {
@@ -126,11 +126,11 @@ namespace Sqlite
126126 void Query::exec ( sqlite3* db, const QString& sql )
127127 {
128128 char *errMsg = nullptr ;
129- int r = sqlite3_exec ( db, sql.toLocal8Bit ().constData (), nullptr , nullptr , &errMsg );
129+ int r = sqlite3_exec ( db, sql.toUtf8 ().constData (), nullptr , nullptr , &errMsg );
130130 if ( r )
131131 {
132132 QString err = QString ( " Query execution error on %1: %2 - %3" ).arg ( sql ).arg ( r ).arg ( errMsg );
133- throw std::runtime_error ( err.toLocal8Bit ().constData () );
133+ throw std::runtime_error ( err.toUtf8 ().constData () );
134134 }
135135 }
136136
0 commit comments