mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Set text codec to UTF8 fixing the handling of special characters
Set the encoding used by Qt to UTF8. This fixes the wrong appearance of special characters caused by SQLite using UTF8 and the application ISO-8859 or whatever.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "MainWindow.h"
|
||||
#include <QApplication>
|
||||
#include <QTextCodec>
|
||||
|
||||
#if defined(Q_WS_MAC)
|
||||
#include <Carbon/Carbon.h>
|
||||
@@ -72,6 +73,12 @@ int main( int argc, char ** argv )
|
||||
QApplication a( argc, argv );
|
||||
a.setOrganizationName("sqlitebrowser");
|
||||
a.setApplicationName("SQLite Database Browser " + QString(APP_VERSION));
|
||||
|
||||
// Set character encoding to UTF8
|
||||
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
|
||||
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
MainWindow w;
|
||||
#if defined(Q_WS_MAC)
|
||||
AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,
|
||||
|
||||
Reference in New Issue
Block a user