Ove Kaaven <[EMAIL PROTECTED]> wrote:

>> Yes, filling RTL_NLS_DATA structure is absolutely no problem. The problem is
>> again to introduce Wine-own-internal interface. There are already plenty of
>> them. I think that using not exported, own, internal functions from external
>> modules such as x11drv is a bad idea. Is it?
>
>Can't data for X11 encodings just be internal to x11drv?

Are the X11 encodings such specific and can not be replaced by the standard
encodings? Having such common feature as support for various encodings in one
place (kernel/ntdll) should help to minimize bugs in handling of encodings
and help in providing additional drivers without excessive complications.

>> NT's NLS:s have 32K characters in OEM to Unicode table instead of 64K as
>> I expected. What do you think about that?
>
>I don't understand what you mean. OEM characters to Unicode would be 256
>characters, wouldn't it? And Unicode to SBCS codepage would be 65536 bytes
>(or 32768 words, as offsets and sizes are almost always expressed as words
>in NLS files).

Sorry, I was not clear. I'll try to clarify better.

With SBCS - no problems:
OEM->Unicode table size = 256 * sizeof(WCHAR),
Unicode->OEM table size = 65536 * sizeof(BYTE).

Let's take c_20261.nls from NT4 and c_950.nls from NT2000:
(chars and offsets in hex)
==============================================================
Trying to open NT c_950.nls
Windows NT format NLS
wSize: 000D
CodePage: 950
MaxCharSize: 2
DefaultChar: 3F 00
UnicodeDefaultChar: 3F
unknown1: 3F
unknown2: 3F
LeadByte[0] = 0081
LeadByte[1] = 00FE
LeadByte[2] = 0000
LeadByte[3] = 0000
LeadByte[4] = 0000
LeadByte[5] = 0000
LeadByte[6] = 0000
LeadByte[7] = 0000
LeadByte[8] = 0000
LeadByte[9] = 0000
LeadByte[10] = 0000
LeadByte[11] = 0000
Size of tables in words 8003 <----
CP_to_Unicode starts at 0000001C, ends at 00010022
Testing CP_to_Unicode table
table[0x30 ('0')] = 0x30 ('0') OK
table[0x39 ('9')] = 0x39 ('9') OK
table[0x41 ('A')] = 0x41 ('A') OK
table[0x5A ('Z')] = 0x5A ('Z') OK
Unicode_to_CP starts at 00010022, ends at 00030022
dwTableSize = 0x20000, dwFileSize = 0x30022
Testing CP_to_Unicode table
table[0x30 ('0')] = 0x30 ('0') OK
table[0x39 ('9')] = 0x39 ('9') OK
table[0x41 ('A')] = 0x41 ('A') OK
table[0x5A ('Z')] = 0x5A ('Z') OK
==============================================================
Trying to open NT c_20261.nls
Windows NT format NLS
wSize: 000D
CodePage: 20261
MaxCharSize: 2
DefaultChar: 3F 00
UnicodeDefaultChar: 3F
unknown1: 3F
unknown2: 3F
LeadByte[0] = 00C1
LeadByte[1] = 00CF
LeadByte[2] = 0000
LeadByte[3] = 0000
LeadByte[4] = 0000
LeadByte[5] = 0000
LeadByte[6] = 0000
LeadByte[7] = 0000
LeadByte[8] = 0000
LeadByte[9] = 0000
LeadByte[10] = 0000
LeadByte[11] = 0000
Size of tables in words 1103 <----
CP_to_Unicode starts at 0000001C, ends at 00002222
Testing CP_to_Unicode table
table[0x30 ('0')] = 0x30 ('0') OK
table[0x39 ('9')] = 0x39 ('9') OK
table[0x41 ('A')] = 0x41 ('A') OK
table[0x5A ('Z')] = 0x5A ('Z') OK
Unicode_to_CP starts at 00002222, ends at 00022222
dwTableSize = 0x20000, dwFileSize = 0x22222
Testing CP_to_Unicode table
table[0x30 ('0')] = 0x30 ('0') OK
table[0x39 ('9')] = 0x39 ('9') OK
table[0x41 ('A')] = 0x41 ('A') OK
table[0x5A ('Z')] = 0x5A ('Z') OK
==============================================================

Why the sizes are so different? Or cp950 has additional OEM tables
(with displayable symbols)?

Dmitry.

Reply via email to