8000 Read the text of Access 97 files in the code page of the database by dominion525 · Pull Request #101 · dominion525/jetdb · GitHub
[go: up one dir, main page]

Skip to content

Read the text of Access 97 files in the code page of the database - #101

Merged
dominion525 merged 4 commits into
mainfrom
fix/jet3-code-page
Oct 17, 2026
Merged

dominion525 merged 4 commits into
mainfrom
fix/jet3-code-page

Conversation

@dominion525
Copy link
Copy Markdown
Owner

Summary

  • Access 97 (Jet3) stores text in the code page of the database, but jetdb always read it as Latin-1. Japanese files (code page 932) came out garbled, names of tables and columns included, so a table could not even be found by its name. In Western files (1252), bytes 0x80 to 0x9F, such as the euro sign and the trademark sign, came out as controls.
  • PageReader::text_encoding tells from the header how a file stores text, as the new TextEncoding: in the code page of the header for Jet3, in UTF-16LE later. The values, memos, column and index names, properties and Access 97 macros of a Jet3 file are read in that code page with encoding_rs, already a dependency, and as Latin-1 when jetdb does not know the code page. mdbtools and Jackcess read the code page of the header too. In the Jet3 test files, the code page of every text and memo column agrees with the header.
  • TextEncoding takes the place of is_jet3 where text is read. This changes the arguments of entry_properties and encoding::decode_text, and replaces TableDef::is_jet3 with TableDef::text_encoding, breaking changes for 0.4.0.
  • testdata/V1997/japaneseTestV1997.mdb is a new test database in code page 932, made with DAO 3.6 by testdata/jet3-generators/jet3-japanese-generator.vbs, as Access 2013 and later cannot create Access 97 files. New tests check that its Japanese table, column, index and query names, column description and values read as they were written, half-width katakana and ①~髙 included, and that the code page 1252 characters of testIndexCodesV1997.mdb read as such. Reading as Latin-1 again makes both fail.
  • README.md / README.ja.md, docs/lib.md / docs/lib.ja.md and the crate documentation describe how Jet3 text is read.

🤖 Generated with Claude Code

dominion525 and others added 4 commits October 17, 2026 16:01
- Add japaneseTestV1997.mdb, an Access 97 database in code page 932 made with DAO 3.6, with Japanese names of a table, its columns, an index and a query, a Japanese column description, and Japanese values, among them half-width katakana and characters that some converters map differently
- Add the script that made it, jet3-japanese-generator.vbs, and describe in SOURCES.md how it was made

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Access 97 (Jet3) stores text in the code page of the database, but it was always read as Latin-1: Japanese (code page 932) came out garbled, and in Western files (1252) characters such as the euro sign and the trademark sign came out as controls
- Add TextEncoding, how a file stores text, which PageReader::text_encoding tells from the code page in the header, and read the values, memos, column and index names, properties and Access 97 macros of a Jet3 file in that code page, or as Latin-1 when jetdb does not know it
- Take TextEncoding in place of is_jet3 where text is read, which changes the arguments of entry_properties and encoding::decode_text, and replaces TableDef::is_jet3 with TableDef::text_encoding
- Add tests that the Japanese names, values, description and query of japaneseTestV1997.mdb, and the code page 1252 characters of testIndexCodesV1997.mdb, read as they should

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… the database

- Say in README.md and README.ja.md that Jet3 text is in the code page of the database, not Latin-1
- Say after the table of supported versions in docs/lib.md, docs/lib.ja.md and the crate documentation that jetdb reads Jet3 text in the code page in the header, and as Latin-1 when it does not know the code page

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Move the reading of a single-byte string, in the code page or as Latin-1, into single_byte_string, which takes the closure that reads the strings of a row from a cyclomatic complexity of 10 to 7
- Correct the name of the argument the documentation of parse_macro_grid still gave

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@dominion525
dominion525 merged commit 15008bb into main Oct 17, 2026
10 checks passed
@dominion525
dominion525 deleted the fix/jet3-code-page branch October 17, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0