Hi,
I'd like to translate LMCE UI to Russian. But as I know now it isn't just a matter of translation of all descriptions in the Text_LS. The main problem is to convert database to the UTF8 and then from the client tell to mysql that opened connection is in UTF8. I described all steps to have UTF8 data in the
Translate the GUI into another language. But still have a troubles with sending UTF8 option before connection to the database.
As I found the part where actual connection is done is db_wrapper. All methods such db_init(), db_real_connect() etc are just map to the mysql C API in the db_wrapper_mysql.h. The central point where connection method is called is PlutoUtils/DBHelper.h. I added there that code:
db_wrapper_options(m_pDB, MYSQL_SET_CHARSET_NAME, "utf8");
right after
m_pDB = db_wrapper_init(NULL);
Then I rebuilt three packages - pluto-orbiter, pluto-orbitergen and pluto-plutoutils, installed them and regenerated Orbiter. But without luck. The Russian letters are displayed like question mark. I have a simple Perl script to check if Russian titles are in UTF8:
#!/usr/bin/perl -w
use strict;
use warnings;
use utf8;
binmode STDOUT, ":utf8";
use DBI;
use Data::Dumper;
my $db_host = 'localhost';
my $db_name = 'pluto_main';
my $db_user = 'root';
my $db_pass = '';
my $dbh = DBI->connect("dbi:mysql:$db_name;host=$db_host", $db_user, $db_pass) or die "Cannot connect to $db_name: $DBI::err!";
$dbh->{'mysql_enable_utf8'} = 1;
$dbh->do('SET NAMES utf8');
my $query = "SELECT FK_Text, Description FROM Text_LS WHERE FK_Language=5";
my $res = $dbh->prepare($query) or die "Cannot prepare query: $DBI::err!";
my $rv = $res->execute() or die "Cannot execute query: $DBI::err!";
my $result = $res->fetchall_arrayref({});
my $count = 0;
for my $row (@$result) {
my $msg = $row->{Description};
print "$row->{FK_Text}: " . $msg . "\n";
}
$dbh->disconnect();
When I run it on the 0810 test machine with Russian language in the Text_LS it gives a proper output. But if those two rows are commented:
$dbh->{'mysql_enable_utf8'} = 1;
$dbh->do('SET NAMES utf8');
it output Russian text as question marks (the same as Orbiter). So, maybe somebody have some idea what's wrong with database connection. Will be very appreciated for any help since I don't have a wide experience with C++.
TIA