I try insert into SqLite text with Russian and Korean chars (debian x64) over TSQLQuery
I have different result if build console application and gtk2 application
SQLQuery11.FieldByName('name').AsString := ('
RU:белая PL:ŁĘŃÓĆ KR:흰 염소');
gtk2 text
in sqlite database is correct "
RU:белая PL:ŁĘŃÓĆ KR:흰 염소"
console application
write to database over SQLQuery11 result is "U:белаÑ. PL:Å.Ä.Å.Ã.Ä. KR:í.° ì.¼ì.."
SQLite3Connection11.ExecuteDirect works correct on both platform ,
Where's my mistake?unit test_unit;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, SQLite3Conn, SQLDB;
procedure my_test;
implementation
procedure my_test;
// need: uses SQLite3Conn, SQLDB
var
SQLite3Connection11: TSQLite3Connection;
SQLQuery11: TSQLQuery;
SQLTransaction11: TSQLTransaction;
begin
SQLite3Connection11:=TSQLite3Connection.Create(nil);
SQLTransaction11 := TSQLTransaction.Create(nil);
SQLQuery11:= TSQLQuery.Create(nil);
SQLite3Connection11.DatabaseName:='koza.db';
SQLite3Connection11.Transaction := SQLTransaction11;
SQLite3Connection11.Open;
// create table
SQLite3Connection11.ExecuteDirect('create table IF NOT EXISTS koza (ID INTEGER PRIMARY KEY AUTOINCREMENT, name text)');
// insert
SQLite3Connection11.ExecuteDirect('insert into koza(name) values ("RU:белая PL:ŁĘŃÓĆ KR:흰 염소")');
SQLQuery11.DataBase := SQLite3Connection11;
SQLQuery11.sql.Text:='select * from koza';
SQLQuery11.Open;
SQLQuery11.Insert;
SQLQuery11.FieldByName('name').AsString := ('RU:белая PL:ŁĘŃÓĆ KR:흰 염소');
SQLQuery11.ApplyUpdates;
SQLTransaction11.Commit;
SQLQuery11.free;
SQLTransaction11.free;
SQLite3Connection11.free;
end;
end.