Subject Re: UNICODE_FSS as default charset ?
Author Roman Rokytskyy
Hi,
> I must say that I'm confused, in the newsgroup I read about users
> using Unicode and in the Interbase 6 Developer's Guide (pdf) page 68
> they wrote the following:
> "PreparedStatement setUnicodeStream() InterClient does not support
> UNICODE."

I think this applies only to InterClient 2.01. Borland has InterClient
2.5 which is shipped with InterBase 6.5 only. I suspect that
UNICODE_FSS is supported there. Another option for you is our type 4
JCA-JDBC driver (JBird) which supports Unicode too.

> I'll use Firebird 1.0 on Redhat Linux 7.3(deployment) and Windows
> 2000 SP2(development).
> I'm developing a multi-lingual web application, my client is HTML
> with selection from several charsets for a same language code.
> In the database I'll have to store data in Hebrew and Latin
> languages in separate database columns.
> 1) Should I select UNICODE_FSS as the default charset for the whole
> database or would you advice to use the ISO8859_1 charset as the
> default and the UNICODE_FSS charset for those columns only?
> Disk capacity is not a problem, speed is. (I'll double the column
> length for Unicode)

Have you posted this question to IB-Support group
(http://groups.yahoo.com/group/IB-Support/)? That's the place where
database experts answer database related questions. As far as I know
UNICODE_FSS does not have usefull collation orders except direct byte
comparison. Speed tests you can perform yourself.

> 2) Which version of interclient does support Unicode and where can I
> download it?

InterClient 2.01 is available from Firebird project (binary and
sources). However nobody from Firebird team is interested in
supporting and developing this driver.

InterClient 2.5 you can buy from Borland with InterBase 2.5

JCA-JDBC driver is available from Firebird project (binary and
sources). This driver is actively developed and supported (actually
this is the support group for this driver).

> 3) When I define my connection is it enough to add the following:
> properties.put("charSet", "UTF8");
> or do I need some additional coding for retrieve/store data in
> Unicode?

Should be enough. However I never tried this.

In case of JBird, property is called "lc_ctype" and value should be
"UNICODE_FSS". Note, it is not yet possible to create database with
default charset using our driver (you need to do this with sql script).

> 4) Is there a tool for inserting manually (with sql insert) unicode
> data in the database?

It should not really matter. When you specify charset in your client
(in wisql.exe for example this is SET NAMES), data are sent to
database in charset of the client. Then database server tries to
translate your encoding into encoding of the column. If this
translation is not possible you get an exception, otherwise you have
data in correct encoding in the column.

However, when using Java, ensure that you have correct Unicode string
(usually formed with \u0XXX sequences in source code).
Hope this helps.

Best regards,
Roman Rokytskyy