Interbase table Coding from WIN1251 to UTF8 on fly lazarus / 16-Databases ---------------------------------------------------------------------- samsuser · 2011-04-20 05:55 Hi I have Interbase table with WIN1251 charset . How to  Coding from WIN1251 to UTF8 on fly in Lazarus application ? Wich component to use ? Thank you . ---------------------------------------------------------------------- Lacak2 · 2011-04-21 04:59 If you usu TIBConnection component from sqlDB (component palete), then use TIBConnection.CharSet property and try set it to 'UTF8' ---------------------------------------------------------------------- samsuser · 2011-04-21 22:49 I get error :  IBConnection1:DoInternalConnect: -bad parameters on attach or create database -CHARACTER SET UTF8 is not defined                    ok ---------------------------------------------------------------------- Lacak2 · 2011-04-26 05:57 Which version of Interbase/Firebird do you use ? (for me with Firebird 2.1 it works without error) ---------------------------------------------------------------------- Zoran · 2011-04-27 06:18 We can see here that character set UTF8 was added to Firebird version 2.0. I don't know about Interbase. If you use older version of FB/IB then your server probably cannot convert character set to UTF8. The best thing you can do is of course to upgrade the server to newer version, but perhaps you can't do this (for whatever reason, for example if you don't control the server). Then, the workaround is to use conversion functions from LConvEncoding unit in your fields' OnGetText and OnSetText events. For example: Code: [Select]procedure TForm1.SQLQuery1NAMEGetText(Sender: TField; var aText: string;   DisplayText: Boolean); begin   if not Sender.IsNull then     aText := CP1251ToUTF8(Sender.AsString); end; procedure TForm1.SQLQuery1NAMESetText(Sender: TField; const aText: string); begin   Sender.AsString := UTF8ToCP1251(aText); end; Assign the first procedure to OnGetText event of every text field and assign the second procedure to OnSetText event of every text field updateable by users of your application.