nonelatine charcter with mydac on ubuntu 15.04 server
Posted: Sun 24 Jul 2016 01:39
i was using mydac on windows for a while without any issue with none latine charcter , but when i decided to change the platform of my application to work under ubuntu the none latine charcters comes out as question marks any idea why ?
here is a sample code that work normal on windows but on ubuntu its inserts question marks
username is equal to some arabic charcters so when its inserts on ubuntu it comes out question marks i checked the username value before insert its actual arabic chars after insert they become question marks what iam doing wrong ?
mydac version 8.4.11
here is a sample code that work normal on windows but on ubuntu its inserts question marks
Code: Select all
procedure TConnection.Registerdatadb(const usernamereg: String; const passwordreg: string);
var
dbconnect: TMyConnection;
begin
TThread.Synchronize(nil,
procedure
var
List: TList; // or TIdContextList if using a modern Indy version
I: integer;
Connection: TConnection;
begin
try
dbconnect := TMyConnection.Create(nil);
dbconnect.Pooling := true;
dbconnect.PoolingOptions.Validate := true;
dbconnect.Server := DATABASESERVERLOGIN;
dbconnect.username := Databaseuserlogin;
dbconnect.Password := Databasepassword;
dbconnect.ConnectionTimeout := 0;
connectionmo.userslq.Connection := dbconnect;
dbconnect.Database := Dbname;
dbconnect.Connect;
if usernamereg <> '' then
begin
connectionmo.userslq.Close;
connectionmo.userslq.SQL.Clear;
connectionmo.userslq.SQL.Add
('SELECT * FROM `users` WHERE `username` = "' +
trim(usernamereg) + '"');
connectionmo.userslq.Open;
if not connectionmo.userslq.IsEmpty then
begin
Exit;
end
else
begin
connectionmo.userslq.Close;
connectionmo.userslq.SQL.Clear;
connectionmo.userslq.SQL.Add
('INSERT INTO `users` (`username`, `password`) VALUES (:uname, :pass);');
connectionmo.userslq.ParamByName('uname').AsString := trim(usernamereg);
connectionmo.userslq.ParamByName('pass').AsString := trim(passwordreg);
connectionmo.userslq.ExecSQL;
connectionmo.userslq.Close;
end;
end;
finally
dbconnect.Disconnect;
dbconnect.Free;
end;
end);
end;mydac version 8.4.11