How to store Unicode in a database Firebird 1.5 with Delphi 6 components ?


I begin a project which use unicode.
I have downloaded the "tntunicode" components to use unicode with delphi 6.
I have also a database firebird 1.5 for windows.
I create a table "PARAM" with 2 fields "ID_PARAM integer" and "LIB_PARAM varchar(100)".

When I tape some chinese characters on the component TntEdit of my application, I can see these characters.
When I click on a button, I store these characters in the database FireBird.
But when I try to recuperate this information from my table PARAM with the statement "select" and display it in a DBGrid, the information is not correctly displayed (the grid shows the characters "????" instead of my data).

Can someone help me solve this problem ?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

the dbgrid is not able to display unicode,
why not display it again in the tntedit?
ryukenAuthor Commented:
With the package TntUnicode Components, I have the TntDBGrid witch can display unicode characters.
and u use TntDBGrid for display?
(just reasking, because in the initial-question you told about dbgrid)

meikl ;-)
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

ryukenAuthor Commented:
I have also test to display the unicode characters with a TntEdit.
But I have these characters '????' instead of chinese characters.

When I store the characters in the database, I can see '????' with the IBOConsole for FireBird.
And when I recuperate these characters with a statement "select" in a TntEdit or a TntDbGrid, I have the '????'.

Maybe, Delphi 6 modify my characters when I try to save them in the database ?
what components do u use for the connection (ib..., bde)?
ryukenAuthor Commented:
I use the components of Delphi 6 :
 - SQLConnection1 of DBExpress
 - SQLQuery1 of DBExpress
 - DataSetProvider1 of AccessDB
 - ClientDataSet1 of AccessDB
did you set the localeCode and the ServerCharset-parameters
of the sqlConnection?
ryukenAuthor Commented:
No I don't know how to set this information!
have you got a localeCode and a ServerCharset-parameters
for unicode ?
following i have found,
did not know, which one you need

LocaleCode description
1028 Chinese (Taiwan)
2052 Chinese (China)
3076 Chinese (Hong Kong)
4100 Chinese (Singapore)
5124 Chinese (Macau)

searching now for serverCharset

meikl ;-)
see following article

(its for postgres with dbexpress-drivers, but should be adaptable)

meikl ;-)
ryukenAuthor Commented:
Sorry, I try to complete the params of the component SQLConnection1 with these values :
 - LocaleCode = 2052
 - ServerCharSet = UNICODE_FSS

But that don't work well.
I always display the characters '????' in the TntEdit or the TntDBGrid.
try this change

- ServerCharSet = /UNICODE_FSS

maybe the server uses itself a different charset

meikl ;-)

ryukenAuthor Commented:
with ServerCharSet = /UNICODE_FSS , I have the error in Delphi 6 :
:-( digging in the dark

searching further . . .
ryukenAuthor Commented:
I will try to search on "" and "" for more information about unicode with Delphi.
i have also had a problem with unicode and delphi
i was writting a dll that excripts a normal string into other chars that look the same with the eye.

i input a word ($0062//b) id output from my dll $044A with looks like a b but when i try to show this information in an editbox i get the wrong chars and also when i save the raw word data to a file without formating humm computers dont like multibyte chars full stop!

>> - SQLConnection1 of DBExpress
>> - SQLQuery1 of DBExpress
>> - DataSetProvider1 of AccessDB
>> - ClientDataSet1 of AccessDB

ClientDataSet doesn't support unicode, for the others I don't know, but I suppose that the problem cames from this.

I made it work with ADODataSet but this doesn't help you.

For the database Firebird 1.5 I don't know for sure, but you can try the Jedi Components, which are unicode (i've tested the jedi dataset and worked ok).
You can take a look on

ryukenAuthor Commented:

I have download the Jedi Components for Delphi 6.
And I have found that there is some unicode functions that can help me.
Maybe the ClientDataSet can't support unicode characters.

yes, as far as I know, the ClientDataSet doesn't support unicode

PAQed with points refunded (500)

Community Support Moderator

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.