Solved

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

Posted on 2003-12-09
21
870 Views
Last Modified: 2010-04-05
Hello!

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 ?

thanks!
0
Comment
Question by:ryuken
  • 8
  • 8
  • 2
  • +2
21 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9902803
the dbgrid is not able to display unicode,
why not display it again in the tntedit?
0
 

Author Comment

by:ryuken
ID: 9902829
With the package TntUnicode Components, I have the TntDBGrid witch can display unicode characters.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9902862
and u use TntDBGrid for display?
(just reasking, because in the initial-question you told about dbgrid)

meikl ;-)
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:ryuken
ID: 9902972
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 ?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9903015
what components do u use for the connection (ib..., bde)?
0
 

Author Comment

by:ryuken
ID: 9903046
I use the components of Delphi 6 :
 - SQLConnection1 of DBExpress
 - SQLQuery1 of DBExpress
 - DataSetProvider1 of AccessDB
 - ClientDataSet1 of AccessDB
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9903096
did you set the localeCode and the ServerCharset-parameters
of the sqlConnection?
0
 

Author Comment

by:ryuken
ID: 9903147
No I don't know how to set this information!
have you got a localeCode and a ServerCharset-parameters
for unicode ?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9903622
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 ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9903648
see following article

http://www.vitavoom.com/Products/pgExpress_Driver/docs/localization.html

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

meikl ;-)
0
 

Author Comment

by:ryuken
ID: 9903767
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.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9903791
try this change

- ServerCharSet = /UNICODE_FSS

maybe the server uses itself a different charset

meikl ;-)

0
 

Author Comment

by:ryuken
ID: 9903844
with ServerCharSet = /UNICODE_FSS , I have the error in Delphi 6 :
"CHARACTER SET /UNICODE_FSS is not defined"
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9903962
:-( digging in the dark

searching further . . .
0
 

Author Comment

by:ryuken
ID: 9904307
I will try to search on "www.ibphoenix.com" and "www.borland.com" for more information about unicode with Delphi.
0
 
LVL 1

Expert Comment

by:mgazza
ID: 9906398
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!
0
 
LVL 6

Expert Comment

by:bpana
ID: 9923519
hi,

>> - 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 http://jvcl.sourceforge.net/

Bogdan.
0
 

Author Comment

by:ryuken
ID: 9928999
Hello,

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.
0
 
LVL 6

Expert Comment

by:bpana
ID: 9929081
hi,

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

Bogdan
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 13056298
PAQed with points refunded (500)

modulo
Community Support Moderator
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
When I am typing into a TEdit last word repeats 7 147
Run video youtube webbrowse 10 65
Convert GUI app into console app for Win32 Env 5 109
MS Access from Delphi 31 60
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question