Subject Re: [firebird-support] How to use Unicode with Firebird???
Author Ivan Prenosil
> Hi! I'm having a little problem trying to use Unicode on Firebird

If you connect to the database with the same character set
as the database/fields are defined with, then basically Firebird
will not touch the values - what you store is what you get back.

However if you want to use UNICODE_FSS, you can encounter
some problems.

* If you prepare statement returning unicode value, the reported length
is in characters, not in bytes (thus, unless you correct that value by hand,
the allocated buffer will be too short). It is corrected in FB2.

* The other problem is that there are several different encodings of unicode.
Although unicode_FSS variant has many advantages, it is less broadly
used, and it is quite possible your components do not support it.

So, although unicode_fss *is* the correct character set, you may find
that it is better to avoid it. I would recommend, as a first step,
to try character set NONE (both as connect charset and for creating db fields)
and see whether it will solve your problems.


> 3) What's the best acess component for using unicode? I'm using IBX
> (IBDatabase + IBDataSet). I wonder if they can work with UNICODE...
> Maybe not... In that case, what components should I use?

Standard Delphi components do not support unicode at all.

Ivan

----- Original Message -----
From: "kurei_spin" <kurei_spin@...>
To: <firebird-support@yahoogroups.com>
Sent: Monday, September 05, 2005 3:36 PM
Subject: [firebird-support] How to use Unicode with Firebird???


> Hi! I'm having a little problem trying to use Unicode on Firebird
> 1.5.
> I'm trying to store in a Firebird 1.5 database words with japanese
> characters. In order to visualize japanese characters i'm using
> TntUnicode Controls (http://www.tntware.com/delphicontrols/unicode).
> I
> comes with a tntDBEdit. I've created my FB Database with UNICODE_FSS
> character set. I've created my table with the same character set. So
> when I write the japanese characters everything is OK. When I post
> the
> registry the Text of TntDBEdit changes to "?". What am I doing wrong?
>
> 1) Is UNICODE_FSS the correct character set?
> Ps.: I've tried SJIS_0208 and EUCJ_0208 too but still don't
> work...
> 2) What is the correct type of field to receive this characters?
> Varchar or blob? I already tried both but still don't work.
> 3) What's the best acess component for using unicode? I'm using IBX
> (IBDatabase + IBDataSet). I wonder if they can work with UNICODE...
> Maybe not... In that case, what components should I use?