FIBPlus versions 6.0 upwards do support UNICODE. Earlier FIBPlus versions did not have this feature, that's why it was NOT possible at all to use charset of the UNICODE_FSS connection and no details about the database contents were provided . This article is aimed at explaining how to work with UNICODE correctly.

If you declare, i.e.

the server will keep the data of the field NAME_1251 in the charset WIN1251, NAME_1252 in WIN1252 and NAME_UNICODE in UNICODE_FSS respectively.

You may set the connection charset in connection parameters. I.e.on setting charset to WIN1251, the client reports to the server that it can work only with charset WIN1251. In respond to this after getting any query from the above-mentioned table, the server tries to recode the data into charset WIN1251 and show the result in this charset. If some string field cannot be recoded, the client will receive an error report from the the server on fetching a record. In other words, the server usually responds to the connection in the charset defined in connection parameters. Getting modification queries, it also considers them to be in the connection charset. Then the server tries to recode the data into a certain field charset.

Now we will show what happens to connection with UNICODE_FSS. The client receives data in UNICODE_FSS. The data must be sent back also in UNICODE_FSS, because the connection parameter is set to UNICODE_FSS. This means that for such a connection you should recode the data into WideString after receiving them (otherwise they will be shown incorrectly). Before sending the data back you should recode them into UNICODE_FSS, that is into UTF8String.

In case of charset NONE the server recodes and controls nothing. Having fields of the UNICODE_FSS type you should do necessary recoding yourself. In case of other field types you should not allow, for example, WIN1252 symbols to appear in the WIN1251 field. You may use some client tools for this purpose. If WIN1252 appear in the WIN1251 field, the data being read will be interpreted incorrectly. Thus you may easily work with a multi lingual database and keep the data in any language in UNICODE_FSS columns. Any string may have symbols in English, Russian, Chinese and any other languages at once. You should only remember that such a string may be read only in charset NONE and UNICODE_FSS. In charset NONE the server recodes nothing, so there are no error messages. In case of UNICODE_FSS the connection charset is similar to the field charset, thus the string is also received with no changes and recoded at the client.

You should remember about two issues:

  1. No recoding is ever done for charset OCTETS and NONE, so you shouldn't work with these fields in any connection charset.
  2. InterBase and Firebird show an error "Arithmetic overflow or string truncate" if you read fields in charsets, other than UNICODE, OCTETS or NONE, in UNICODE. This happens because the server is "puzzled". On one hand it has a declared field length, on the other hand, it responds to the client in UNICODE, i.e, the length of the response in bytes may be more than that of the declared field. For instanse filling in the WIN1251 field with maximum data and then using UNICODE connection, you may get this error.

There are two ways of from this situation. The first one implies asking Firebird/InterBase developers to fix this bug. The second suggests writing queries with forced CAST, which provides longer length for each such field.

FIBPlus versions 5.3 downwards don't know about such peculiarities, so they cannot do such field recoding. FIBPlus 6.0 and its next versions correctly work with UNICODE.

Note: Standard components cannot work with UNICODE strings! For this purpose use only special controls with defined UNICODE charsets, they will show UNICODE strings correctly after the above-mentioned recoding.

Preview text: 

FIBPlus versions 6.0 upwards do support UNICODE. Earlier FIBPlus versions did not have this feature, that's why it was NOT possible at all to use charset of the UNICODE_FSS connection and no details about the database contents were provided . This article is aimed at explaining how to work with UNICODE correctly.

Prices in Euro:

235 (1 copy)
1250 (unlimited)

Volume discounts are available...


We are a small software company with thousands of customers delivering comany wide systems including accounting, logistics, e-commerce, POS, sales etc etc. Several years ago, when we were still a very small company, we used Delphi 3 and Paradox combined with BDE. As our system (and customer base) grew I decided to switch to Delphi 5 and Interbase. Being a huge improvement over Delphi 3 and Paradox, I encountered numerous problems with IBX: memory leaks, performance issues and other problems. Borland was not to be bothered: IBX was provided "as is" and no support was avaliable. 
Not being very eager to use third party components with Delphi at first, I decided to give FIBPlus a try. At once all problems where gone: no more memory leaks and  performance was very consistent. 
But the real advantage of switching to FIBPlus came with the upgrade to D2005: after upgrading there were some problems with the new FIBPlus version. After emailing the problem I received an update within an hour! And this was at 11 pm! A few other (smaller) errors where handled in the same way. 
Our motto is: software is as good as its support. And support of Devrace is just great!
Just a little indication of our FIBPlus use: all our software runs 100% on FIBPlus. Our customers have a total of aprox. 4.800 Firebird databases in production, with a combined size of over 130TB and over 80 million transactions a day. Every
day. And FIBPlus has not failed a single transaction. Not once. There is, however, one (minor) drawback in using FIBPlus: while debugging an application which uses and invalid SQL instruction, de Delphi Debugger returns to the FIBPlus code instead of to our calling code (where the actual error comes from), thereby complicating de debug proces a little. But that is a very small price to pay for a otherwise brilliant third party solution! >>

Bas Jordans JorSoft Ltd
Download full versions and updates in your Personal Area