Firebird info
FlameRobim admintool info

UPDATE: Be ready to jump to Firebird2 version, it has fixed major unicode_fss problems and now has UTF8 encoding attribute. And FlameRobin admintool is way to go. Problem described here is still valid if you use UNICODE_FSS charset for string columns. Just start using UTF8 charset attribute to fix problems.

Firebird Unicode IS NOT properly implemented
This applies to Firebird1 only, problems have been fixed in Firebird2 release.

Yes, it does have UNICODE_FSS (unicode charset) support, but it has one serious flaw. It uses UTF8 as internal format where characters can be from 1 to 3 bytes long. Keep in mind, that character and byte is not equalents in unicode world. Here are three UTF8 characters and what they look in hexeditor.
A = 1 byte long, 1 character long (0x41)
Ä = 2 bytes long, 1 character long (0xC3 0x84)
€ = 3 bytes long, 1 character long (0xE2 0x82 0xAC)


And what is that flaw in Firebird?
You have a chance to insert max 3*varchar lenght characters in varchar column :-( but it's not what you want to happen from SQL schema point of view. And clearly no other database server in the known world allows to do so.....except Firebird server. Its even worse situation in char column where spacepadding happens.

Create a testdb with isql.exe commandline tool, but do not insert records with it. It cannot 
handle unicodes atm.
SQL> CREATE DATABASE 'c:\data\testdb2.fdb' 
     user 'sysdba' password 'masterkey' DEFAULT CHARACTER SET UNICODE_FSS;
SQL> SELECT * FROM rdb$database;

Then create a test table:
CREATE TABLE Customers (
  id integer NOT NULL PRIMARY KEY,
  custno integer NOT NULL UNIQUE,
  name varchar(50),
  city varchar(15),
  balance numeric(12,3),
  isactive varchar(1)
);

Use Jaybird jdbc or dotNETProvider to insert records:
INSERT INTO Customers VALUES(1, 1001, 'CustA', '', 1.11, 'A');
INSERT INTO Customers VALUES(2, 1002, 'CustB', '', 2.22, 'AB');
INSERT INTO Customers VALUES(3, 1003, 'CustC', '', 3.33, 'ABC');
INSERT INTO Customers VALUES(4, 1004, 'CustD', '', 4.44, 'ÄD');
Do you think MSSQL (using nvarchar coltype) or Oracle would allow all four inserts, definitely not. But Firebird is happy with all four inserts :-( and this will break your data integrity.

If you have access to news.atkin.com sourceforge.firebird.devel list you can find a long discussion about the related problem "Possible bug in CHAR padding in case of UNICODE_FSS".

Small JaybirdJdbc and dotNET test program
Char col and UNICODE_FSS problem

Charset and collation in FB


m a i l m u r @ y a h o o . c o m