[fpc-devel] String and UnicodeString and UTF8Stringt

Joost van der Sluis joost at cnoc.nl
Wed Jan 12 14:40:09 CET 2011


On Wed, 2011-01-12 at 11:02 +0100, LacaK wrote:
> Yes, this is not primary question of database side, but db client 
> library api, which is used by SQLConnector to retrieve data.
> For example in ODBC we use SQLGetData in LoadField method to retrieve 
> data from odbc interface.
> And for example in case of MS SQL Server character data are retrieved in 
> current ANSI code page (in Windows of course, may be that for example in 
> *nix data are retrieved in UTF-8 naturaly) .
> (AFAIK there is no universal way how to explicitly request character 
> encoding from ODBC interface)

Almost each DB-server has a setting to specify the encoding, which has
to be added to the connection-string.

> So it is true, that every sql connector is mandatory write character 
> data in UTF-8 ?
> or can write in some native format (Ansi, UTF-16) ... but in this case 
> must somewhere write additional info about actual encoding.

If you add a hook that converts this data, yes. (I woudn't do that, use
the database-servers functionality instead)

Joost.




More information about the fpc-devel mailing list