@@ -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 = QStringLiteral ( " %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 );
@@ -92,12 +92,12 @@ namespace Sqlite
9292 , stmt_( nullptr )
9393 , nBind_( 1 )
9494 {
95- QByteArray ba ( q.toLocal8Bit () );
95+ QByteArray ba ( q.toUtf8 () );
9696 int r = sqlite3_prepare_v2 ( db, ba.constData (), ba.size (), &stmt_, nullptr );
9797 if ( r )
9898 {
9999 QString err = QStringLiteral ( " Query preparation error on %1: %2" ).arg ( q ).arg ( sqlite3_errmsg ( db ) );
100- throw std::runtime_error ( err.toLocal8Bit ().constData () );
100+ throw std::runtime_error ( err.toUtf8 ().constData () );
101101 }
102102 }
103103
@@ -110,7 +110,7 @@ namespace Sqlite
110110
111111 Query& Query::bind ( const QString& str, int idx )
112112 {
113- QByteArray ba ( str.toLocal8Bit () );
113+ QByteArray ba ( str.toUtf8 () );
114114 int r = sqlite3_bind_text ( stmt_, idx, ba.constData (), ba.size (), SQLITE_TRANSIENT );
115115 if ( r )
116116 {
@@ -127,11 +127,11 @@ namespace Sqlite
127127 void Query::exec ( sqlite3* db, const QString& sql )
128128 {
129129 char *errMsg = nullptr ;
130- int r = sqlite3_exec ( db, sql.toLocal8Bit ().constData (), nullptr , nullptr , &errMsg );
130+ int r = sqlite3_exec ( db, sql.toUtf8 ().constData (), nullptr , nullptr , &errMsg );
131131 if ( r )
132132 {
133133 QString err = QStringLiteral ( " Query execution error on %1: %2 - %3" ).arg ( sql ).arg ( r ).arg ( errMsg );
134- throw std::runtime_error ( err.toLocal8Bit ().constData () );
134+ throw std::runtime_error ( err.toUtf8 ().constData () );
135135 }
136136 }
137137
0 commit comments