I have saved some data into a firebird table. The field has been set to GB_2312. When I retrieve the data to display in a textbox where the font keyset has been set to GB_2312, it does not show the Chinese word correctly. What did I miss? The Chinese word I stored in Firebird table is “书”. When I retrieved the data and show in Delphi 6 textbox, it shows “涔? “. I am expecting “书”. Thanks for your help.
I have added a param “lc_ctype=UTF8” when I opened the Firebird connection. I also have set the keyset for the field as GB_2312.
I have set the font for the textbox as “SimSun-ExtB 20” to support Simplified Chinese.
I am not sure whether the method I am using for saving or retrieval is wrong.
This is the code on retrieving data from Firebird table.
sSQL:='select * from Song where '+
'Type='''+sType+''' and '+
'Language='''+sLang+''' and '+
'SongNo='+sSongNo;
if openqry(qry,db, tx, sSQL) then
edtSongName.text:=qry.FieldByName('SongName').asString;
This is the code on saving data into it. The variable string is sDesc.
sSQL:='insert into SongDetl(Type,Language,SongNo,Line,LType,Desc) values '+
'(:Type,:Language,:SongNo,:Line,:LType,:Desc)';
if not runSQL(sSQL,db,tx,sType,sLang,vals(nSongNo),vals(i),sLType,sDesc) then
msgbox('Problem saving data.');
John is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3