mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-02-26 05:33:03 +08:00
Merge pull request #227 from evanmiller/index-lang
Use the language ID from the DB header for indexing
This commit is contained in:
@@ -247,6 +247,7 @@ typedef struct {
|
|||||||
/* reference count */
|
/* reference count */
|
||||||
int refs;
|
int refs;
|
||||||
guint16 code_page;
|
guint16 code_page;
|
||||||
|
guint16 lang_id;
|
||||||
} MdbFile;
|
} MdbFile;
|
||||||
|
|
||||||
/* offset to row count on data pages...version dependant */
|
/* offset to row count on data pages...version dependant */
|
||||||
|
|||||||
@@ -231,6 +231,11 @@ static MdbHandle *mdb_handle_from_stream(FILE *stream, MdbFileFlags flags) {
|
|||||||
RC4_set_key(&rc4_key, 4, (unsigned char *)&tmp_key);
|
RC4_set_key(&rc4_key, 4, (unsigned char *)&tmp_key);
|
||||||
RC4(&rc4_key, mdb->f->jet_version == MDB_VER_JET3 ? 126 : 128, mdb->pg_buf + 0x18);
|
RC4(&rc4_key, mdb->f->jet_version == MDB_VER_JET3 ? 126 : 128, mdb->pg_buf + 0x18);
|
||||||
|
|
||||||
|
if (mdb->f->jet_version == MDB_VER_JET3) {
|
||||||
|
mdb->f->lang_id = mdb_get_int16(mdb->pg_buf, 0x3a);
|
||||||
|
} else {
|
||||||
|
mdb->f->lang_id = mdb_get_int16(mdb->pg_buf, 0x6e);
|
||||||
|
}
|
||||||
mdb->f->code_page = mdb_get_int16(mdb->pg_buf, 0x3c);
|
mdb->f->code_page = mdb_get_int16(mdb->pg_buf, 0x3c);
|
||||||
mdb->f->db_key = mdb_get_int32(mdb->pg_buf, 0x3e);
|
mdb->f->db_key = mdb_get_int32(mdb->pg_buf, 0x3e);
|
||||||
if (mdb->f->jet_version == MDB_VER_JET3) {
|
if (mdb->f->jet_version == MDB_VER_JET3) {
|
||||||
|
|||||||
@@ -389,7 +389,7 @@ mdb_index_hash_text(MdbHandle *mdb, char *text, char *hash)
|
|||||||
out_ptr[i*2] = text[i];
|
out_ptr[i*2] = text[i];
|
||||||
out_ptr[i*2+1] = 0;
|
out_ptr[i*2+1] = 0;
|
||||||
}
|
}
|
||||||
if (!(k=DBLCMapStringW(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), 0),
|
if (!(k=DBLCMapStringW(MAKELCID(mdb->f->lang_id, 0),
|
||||||
LCMAP_LINGUISTIC_CASING | LCMAP_SORTKEY | NORM_IGNORECASE | NORM_IGNOREKANATYPE | NORM_IGNOREWIDTH,
|
LCMAP_LINGUISTIC_CASING | LCMAP_SORTKEY | NORM_IGNORECASE | NORM_IGNOREKANATYPE | NORM_IGNOREWIDTH,
|
||||||
(WCHAR*)out_ptr, len, (LPBYTE)hash, len*2)))
|
(WCHAR*)out_ptr, len, (LPBYTE)hash, len*2)))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user