[Qt-interest] Problem migrate frensh characters from Interbase to Mysql
HEDFI Mourad
mourad at bilog.fr
Wed Feb 4 08:56:57 CET 2009
Hello everybody, I've written a Qt program which migrate data from an
Interbase database to a MySQL database.
It works fine but I've a problem with frensh characters like (é, è, à, etc).
Those charcaters are fine in the interbase database, but after executing the
select request to have data and I display the data I've selected those
characters are displayed as " ? ".
This my connection function
Source code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
QSqlDatabase db = QSqlDatabase::addDatabase(driver, name);
db.setHostName(host);
db.setDatabaseName(path);
db.setUserName(user);
db.setPassword(pwd);
if(driver == "IBASE")
db.setConnectOptions("ISC_DPB_LC_CTYPE = LATIN1");
if(!db.open())
{
qCritical() << "Erreur Ouverture base de données : " <<
db.lastError().text();
return false;
}
return true;
.
Can anyone tel me where I'm wrong and how to do resolve this problem.
Knowing that I've tried to user QTextCodec like
Source code
1
2
QTextCodec *codec = QTextCodec::codecForName("LATIN1");
qDebug() << codec->toUnicode(q1.value(1).toByteArray());
but I've always the same result " ? ".
Many thanks in advance.
Best Regurads.
HEDFI Mourad.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090204/26afcd2a/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 403 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090204/26afcd2a/attachment.gif
More information about the Qt-interest-old
mailing list