mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-01-24 13:52:18 +08:00
Simplify header-reading logic and support JET3 code pages
Using the notes and RC4 key provided in the HACKING file, decrypt the database definition page all at once instead of decrypting individual fields with ad-hoc keys. Use the newly decrypted header to access the database code page at offset 0x3C, and use this numeric value to initialize the iconv converter with an appropriate charset name for popular windows code pages. More encodings can be added later, with the eventual goal of getting rid of the MDB_JET3_CHARSET environment variable. Note that individual columns can have their own code pages but this issue is not addressed. An extra field is added to the MdbFile structure - because this struct is allocated internally, this should not break the public ABI. Finally, only set the db_passwd field if it's a JET3 database (see #144)
This commit is contained in:
@@ -246,6 +246,7 @@ typedef struct {
|
||||
unsigned char *free_map;
|
||||
/* reference count */
|
||||
int refs;
|
||||
guint16 code_page;
|
||||
} MdbFile;
|
||||
|
||||
/* offset to row count on data pages...version dependant */
|
||||
|
||||
Reference in New Issue
Block a user