mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-05-24 22:48:23 -05:00
Fix SQL import of files with BOM
This fixes the import of SQL files with a leading BOM. See issue #2323.
This commit is contained in:
+4
-1
@@ -26,6 +26,7 @@
|
||||
#include "FindReplaceDialog.h"
|
||||
#include "RunSql.h"
|
||||
#include "ExtendedTableWidget.h"
|
||||
#include "Data.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <QFile>
|
||||
@@ -1407,7 +1408,9 @@ void MainWindow::importDatabaseFromSQL()
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
QFile f(fileName);
|
||||
f.open(QIODevice::ReadOnly);
|
||||
bool ok = db.executeMultiSQL(f.readAll(), newDbFile.size() == 0);
|
||||
QByteArray data = f.readAll();
|
||||
removeBom(data);
|
||||
bool ok = db.executeMultiSQL(data, newDbFile.size() == 0);
|
||||
// Restore cursor before asking the user to accept the message
|
||||
QApplication::restoreOverrideCursor();
|
||||
if(!ok)
|
||||
|
||||
Reference in New Issue
Block a user