Alex Peshkoff wrote:
> On 03/07/15 09:28, liviusliv...@poczta.onet.pl wrote:
>>
>> I've not been following FB3 stuff closely but I'm assuming the
>> API will be working with UTF-8 strings.

> That's not exactly correct. Firebird is using OS support to convert from
> OS default encoding to UTF-8. One can use utf8 strings, but to do it 
> special ag should be added to DPB/SPB. I'm not sure how do windows 
> functions MultiByteToWideChar & WideCharToMultiByte treat CP_ACP, 
> particularly can it result in different encoding for different apps on
> same box. If yes - firebird API is ready to provide both Delphi and 
> FreePascal support, we should care just about correctly declaring string
> types in include file for pascal. Bytes in them will be internally 
> converted to needed form. BTW, environment variables are expected to be
> in same encoding too.

Yes, my statement was loosely written.  More precisely I meant
that FB won't ever be giving us UTF-16, so if we want unicode
from Firebird it will be UTF-8.

Delphi has "AnsiString" type with a codepage attribute that
will probably support most of what people wanted regarding
the handling of specific character sets from the database ...
though I suspect it will usually be simpler just to ask FB
for UTF-8 and be done with it.

None of which is a big deal, it's just a matter of NOT using
"char" and "PChar" in the interface elements of the API,
because in Delphi 2009+ these are UTF-16.  Use AnsiChar and
PAnsiChar and this will work with both Delphi and FPC.

>> provide both Delphi and FreePascal support in example code will
>> need to take care to use specific types, like UTF8String rather
>> than just String.  And PAnsiChar and AnsiChar for the string
>> elements.

-- 
Geoff Worboys
Telesis Computing Pty Ltd


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to