0

We have a Firebird DB with a large number of tables and data. Which has to support both English and Chinese languages. While retrieving the Chinese data from the DB, the data is automatically converted to some other format like this (è¿åŠ¨åž‹).

Actually, we initially created the DB with the charset 'NONE' and later re-registered it with UTF-8 (to support multiple languages).

Connection string is: $"ServerType=1;User=sysdba;Password=masterkey;Dialect=3;Database={FDBPath};client library=fbclient.dll;Charset=UTF8" [Server Type: Embedded]

But it is returning the proper data while using the below connection string: $"ServerType=0;User=sysdba;Password=masterkey;Dialect=3;Database={FDBPath};" [Server Type: Standalone]

After some research, we came to know that the DB has to be created with UTF-8 charset. But as we have a large amount of data, it is not possible to recreate the DB.

We have a workaround to decode the retrieved data to the Chinese language. But it is not a proper solution for this issue.

So, how to retrieve both language data without any issue?

Kathir Subramaniam
  • 1,195
  • 1
  • 13
  • 27
  • Do you know which character set was originally used when storing the Chinese data? Was it `BIG_5` or `GB_2312` (EUC-CN) or something else? What is the non-unicode codepage of the system where it works if you don't set the `Charset` property? – Mark Rotteveel May 06 '19 at 15:50
  • how many databases of this kind exit? If you sell this software to your cxlients and every your client has their database - that is a larger problem. If you have one single database - then the problem is much less. `it is not possible to recreate the DB.` - yes it is! And it is mundane thing, actually. Your database in combination of two things: data (the actual values) and meta-data (AKA scheme, AKA structure, AKA "creating script" - the definition of tables, views, procedures, triggers and other database objects). And that is what you have to do! – Arioch 'The May 06 '19 at 21:24
  • 1)create new database to have the same meta-data except that it would not be NONE but would be in proper encoding from scratch. 2)then make some "data pump" that just pulls data from old DB and insert it into new DB. There were some half-made tools for it, but i am not sure if they are very universal (database constaints may impose quite complex logic in which order which data can be inserted, mere table-by-table copying might be rejected by database meta-data). GOTCHA: in Firebird `VarChar` limit is measured in bytes, and while `NONE` means 1 byte = 1 letter, `UTF-8` means 4 bytes = 1 letter – Arioch 'The May 06 '19 at 21:28

0 Answers0