Codepages
Legacy spreadsheet and text formats may use a codepage rather than UTF-8.
Use the codepage parsing or writing option when you know the file’s encoding.
Modern XLSX files do not need a legacy codepage option.
The full browser build includes the codepage tables. For other distributions, register
the tables from dist/cpexcel.js:
const XLSX = require("@agent-sheet/wasm");XLSX.set_cptable(require("@agent-sheet/wasm/dist/cpexcel.js"));const wb = XLSX.read("Name,Count\nBolt,3", { type: "string", codepage: 1252 });require("node:assert/strict").equal(wb.Sheets.Sheet1.A2.v, "Bolt");In a browser, load the tables after loading the library:
<script src="xlsx.full.min.js"></script><script src="cpexcel.js"></script><script> XLSX.set_cptable(cptable);</script>Copy those files from the published package’s dist folder. The full build already
has the tables, so the extra script is normally unnecessary there.
The bundled tables come from codepage 1.15.0. Their Apache-2.0 license is included
in dist/cpexcel.LICENSE.