Subject | Re: [Firebird-Architect] UTF-8 over UTF-16 |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2005-05-05T10:54:39Z |
On 5 May 2005 at 11:21, Dmitry Yemanov wrote:
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.
>Windows knows nothing about KOI8-R. Should the client libraryCan't say that I completely understand what you wanted to express.
>translate UTF-8 to KOI8-R and then to WIN1251, or directly UTF-8 to
>WIN1251?
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.