mirror of
https://github.com/reactos/reactos.git
synced 2024-09-27 21:16:34 +00:00
[TXT2NLS] TransUniDefaultChar has to be received from WideCharTable. TransDefaultChar has to be received from MultiByteTable (or from DBCS table)
svn path=/trunk/; revision=72708
This commit is contained in:
parent
c75bd6ee1e
commit
40a137dfa8
|
@ -131,6 +131,21 @@ nls_from_txt(const char *txt_file_path, const char *nls_file_path)
|
|||
/* GLYPHTABLE optionally. We do not leave if it is absent */
|
||||
glyph_table = txt_get_glyph_table(txt_file_path, header.UniDefaultChar);
|
||||
|
||||
if (is_dbcs)
|
||||
{
|
||||
/* DBCS codepage */
|
||||
uint16_t *table = (uint16_t*)wc_table;
|
||||
header.TransUniDefaultChar = table[header.UniDefaultChar];
|
||||
/* TODO: TransDefaultChar for DBCS codepages */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* SBCS codepage */
|
||||
uint8_t *table = (uint8_t*)wc_table;
|
||||
header.TransUniDefaultChar = table[header.UniDefaultChar];
|
||||
header.TransDefaultChar = mb_table[LOBYTE(header.DefaultChar)];
|
||||
}
|
||||
|
||||
#ifdef _NLS_DEBUG_PRINT
|
||||
nls_print_header(&header);
|
||||
nls_print_mb_table(mb_table, header.UniDefaultChar);
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
#include <ctype.h>
|
||||
#include <memory.h>
|
||||
|
||||
#define LOBYTE(w) ((uint8_t)((uint32_t)(w) & 0xff))
|
||||
|
||||
#define MAXIMUM_LEADBYTES 12
|
||||
|
||||
typedef struct
|
||||
|
|
|
@ -96,6 +96,7 @@ txt_get_header(const char *file_path, NLS_FILE_HEADER *header)
|
|||
/* Convert string to uint32_t */
|
||||
val = strtoul(p, &p, 16);
|
||||
header->DefaultChar = (uint16_t)val;
|
||||
/* By default set value as DefaultChar */
|
||||
header->TransDefaultChar = (uint16_t)val;
|
||||
|
||||
/* Skip all spaces after default char */
|
||||
|
@ -104,6 +105,7 @@ txt_get_header(const char *file_path, NLS_FILE_HEADER *header)
|
|||
/* Convert string to uint32_t */
|
||||
val = strtoul(p, &p, 16);
|
||||
header->UniDefaultChar = (uint16_t)val;
|
||||
/* By default set value as UniDefaultChar */
|
||||
header->TransUniDefaultChar = (uint16_t)val;
|
||||
|
||||
found = 1;
|
||||
|
|
Loading…
Reference in a new issue