trouble working with UTF8 firebird database
Posted: Mon 16 Nov 2015 12:03
I test IBDAC components under Delphi, and I got a problemwhen it comes to communication with firebird database with utf8 encoding.
The problem is: when I make a query, results containing varchars(N) are recognised as long as their size in the databse, and not N-long. They also fail to encode properly.
So, when I have a field varchar(20) with value "FÓ/2015/08/04", in DataSource i get field with size and length 80 (which is byte-size of this field in database), and value becomes "FĂ“/2015/08/04".
After connecting to database IBCConnection.Options.CharLength keeps changing to 1. All in all it looks like components ignore settings I gave them.
What I want to achieve:
I want to get properly encoded stiring after performing my query.
I want field in DataSource to be N-long when retieveing varchar(N).
What I attempted:
All I could find is that I should set for IBCConnection Charset=UTF8 and UseUnicode=True (first thing I did testing), and suggestion to set EnableMemos=True. But it doesn't work.
Data Source=127.0.0.1;Database=C:\Temp\uc.fdb;User ID=****;Password=*****;Client Library=R:\bin\fbclient.dll;Character Set=UTF8;Login Prompt=False
I tried upgrade firebirdserver to 2.5.4 (so i tested newer version of fbclient.dll as well), but I get same results.
versions of software I use:
I test things on Trial version of IBDAC:
version 5.6.19 for RAD studio XE7
I use firebird server 2.5
The problem is: when I make a query, results containing varchars(N) are recognised as long as their size in the databse, and not N-long. They also fail to encode properly.
So, when I have a field varchar(20) with value "FÓ/2015/08/04", in DataSource i get field with size and length 80 (which is byte-size of this field in database), and value becomes "FĂ“/2015/08/04".
After connecting to database IBCConnection.Options.CharLength keeps changing to 1. All in all it looks like components ignore settings I gave them.
What I want to achieve:
I want to get properly encoded stiring after performing my query.
I want field in DataSource to be N-long when retieveing varchar(N).
What I attempted:
All I could find is that I should set for IBCConnection Charset=UTF8 and UseUnicode=True (first thing I did testing), and suggestion to set EnableMemos=True. But it doesn't work.
Data Source=127.0.0.1;Database=C:\Temp\uc.fdb;User ID=****;Password=*****;Client Library=R:\bin\fbclient.dll;Character Set=UTF8;Login Prompt=False
I tried upgrade firebirdserver to 2.5.4 (so i tested newer version of fbclient.dll as well), but I get same results.
versions of software I use:
I test things on Trial version of IBDAC:
version 5.6.19 for RAD studio XE7
I use firebird server 2.5