c++ - RCC & Russian resources
- Denis Troshin (12/12) Dec 21 2003 Hi!
- Denis Troshin (18/18) Dec 23 2003 OK, I solved this problem by myself.
- Charles (5/23) Dec 25 2003 Woa, did you open this in hex and edit it by hand ?? My hero lol! Thats
- Denis Troshin (2/2) Dec 24 2003 I found out, this problem is because of stupid code in library function
Hi! I have 7.50B5 version of RCC.EXE. When I compile rc-file with russian strings, RCC incorrectly converts these strings to Unicode. rcc -32 test.rc ANSI range of Russian letters is 0xC0-0xFF, in Unicode the range should be 0x410-0x4FF. But RCC converts russian strings the same way as it converts english: - the lower byte of every unicode character is the same as it was in ANSI - the higher byte is 0x0 LANGUAGE statement in RC-file has no effect in my case, and -l switch of RCC.EXE also has no effect.
Dec 21 2003
OK, I solved this problem by myself. So, those who have problems with RCC & Russian resources, you can use my PATCH: if you have RCC.EXE version 7.50B5 (292 864 bytes) write 0x1 instead of 0x0 at address 0x444EA8 (file offset 0x43aa8). ;==== Explanation =========== If variable(or constant?) at this address is 0x1, RCC will convert strings to unicode via MultiByteToWideChar, BUT this variable is always 0, and RCC uses another way of converting: it converts every byte of source ANSI string to word (of course this is WRONG way). I don't know, maybe this variable and two ways of converting were intended for debugging purposes and the author forgot to remove this code. For russian resources(and maybe some others), using MultiByteToWideChar to convert ANSI to Unicode is the only correct way. ;==== If u don't believe me, see code starting from address 0x437820.
Dec 23 2003
Woa, did you open this in hex and edit it by hand ?? My hero lol! Thats some serious hacking :). C "Denis Troshin" <weiv mail.ru> wrote in message news:opr0m4q3yqan535p pop.mail.ru...OK, I solved this problem by myself. So, those who have problems with RCC & Russian resources, you can use my PATCH: if you have RCC.EXE version 7.50B5 (292 864 bytes) write 0x1 instead of 0x0 at address 0x444EA8 (file offset 0x43aa8). ;==== Explanation =========== If variable(or constant?) at this address is 0x1, RCC will convert strings to unicode via MultiByteToWideChar, BUT this variable is always 0, and RCC uses another way of converting: it converts every byte of source ANSI string to word (of course this is WRONG way). I don't know, maybe this variable and two ways of converting were intended for debugging purposes and the author forgot to remove this code. For russian resources(and maybe some others), using MultiByteToWideChar to convert ANSI to Unicode is the only correct way. ;==== If u don't believe me, see code starting from address 0x437820.
Dec 25 2003
I found out, this problem is because of stupid code in library function "mbstowcs" in RCC.EXE.
Dec 24 2003