Use current encoding for the binary check and being able to reset encoding

The current table encoding is used in the binary check, so text encoded in
8-bit encodings is properly recognised as text in the table widget.

Make it possible to reset the encoding used in the way suggested to the
user: "Leave the field empty for using the database encoding". Currently it
was rejecting it with the message: "This encoding is either not valid or
not supported."

See issue #1279
This commit is contained in:
mgrojo
2017-12-31 12:57:48 +01:00
parent a98cd8e8f9
commit 7ce7f0c05b
2 changed files with 2 additions and 2 deletions

View File

@@ -2542,7 +2542,7 @@ void MainWindow::browseDataSetTableEncoding(bool forAllTables)
if(ok)
{
// Check if encoding is valid
if(!QTextCodec::codecForName(encoding.toUtf8()))
if(!encoding.isEmpty() && !QTextCodec::codecForName(encoding.toUtf8()))
{
QMessageBox::warning(this, qApp->applicationName(), tr("This encoding is either not valid or not supported."));
return;