[fpc-devel] String and UnicodeString and UTF8Stringt

LacaK lacak at zoznam.sk
Wed Jan 12 11:02:00 CET 2011

> L> 2. Is it wrong in implementation of TSQLConnectors, which write data
> L> into record buffer (of TStringField) and do not convert them always into
> L> UTF-8 ?
> Do you set the CHARSET field in your TSQLConnector to UTF-8 ?
not all connectors supports CharSet property. When I look into sources 
only MySQL and IB support them (SQLite always return UTF-8 encoded ... 
ODBC, Postgre and Oracle ignore it)

>  Do you define the right code page in each field of your database ?
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)

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.


More information about the fpc-devel mailing list