Subject Re: [Firebird-Architect] UTF-8 over UTF-16
Author Dimitry Sibiryakov
On 5 May 2005 at 11:21, Dmitry Yemanov wrote:

>Windows knows nothing about KOI8-R. Should the client library
>translate UTF-8 to KOI8-R and then to WIN1251, or directly UTF-8 to

Can't say that I completely understand what you wanted to express.

First of all, Windows know KOI8-R. It is code page 20866.

Client library will convert UTF-8 to charset which is specified in
connection string (lc_ctype, you know).
If user has requested Win1251 then (because I can't remember name
of finction which translate charsets directly) fbclient.dll should
use MultiByteToWideChar() to convert UTF-8 into UCS-2 (UTF-16 for
last XP, I suppose) and then WideCharToMultiByte() to convert UCS-2
into code page 1251.
If user has requested KOI8-R (what is strange for Windows)
fbclient.dll must find out somehow (simple map table?) that KOI8-R
code page in windows is 20866. That's what I called "map FB charset
to OS sharset". The same if user requested CYRL which should be
mapped to 866.
SY, Dimitry Sibiryakov.