lib/charcnv.c

Alexander Javoronkov Alexander.Javoronkov at vm.ru
Fri Apr 14 14:12:35 GMT 2000


Does anyone have a clue what strange numbers appear in $SUBJ's / "static
void init_<some codepage>(void)" / update_map ?

Let's analyze init_koi8_r.

We see
'update_map("\200\304\201\263\202\332\203\277\204\300\205\331\206\303\207\264");',

that equals to "\x80\xC4\x81\xB3\x82\xDA\x83\xBF" and so on.

As I see from text of update_map function, it accepts string argument in
form of "<dos char><unix char><dos><unix>", till the \x0.

So, the string above equals to the following convertion:
\x80 -> \xC4
\x81 -> \xB3
\x82 -> \xDA
\x83 -> \xBF

It's clear for me what left-side characters are:
\x80 -> capital russian "A" in cp866
\x81 -> capital russian "B" in cp866
\x82 -> capital russian "V" in cp866
\x83 -> capital russian "G" in cp866

But I just can't catch what the right-side characters are !
When I convert "ABVG" from cp866 to koi8-r, I get
\xE1 -> capital russian "A" in koi8-r
\xE2 -> capital russian "B" in koi8-r
\xF7 -> capital russian "V" in koi8-r
\xE7 -> capital russian "G" in koi8-r

So, what's the real meaning of those "\xC4 \xB3 \xDA \xBF" characters ?
Could someone explain me how to interpret these codepage convertions ?




More information about the samba-technical mailing list