Skip to content

About Chinese garbled code with DBF files #2781

@ZJS248

Description

@ZJS248

EDIT: this issue was resolved in 0.18.11. If you are using an older version, update using the "Installation" instructions in the documentation


when I try to create a dbf file include Chinese words , it translate the words into underline just like this '__'
Here is the code and result :

const xlsx = require("xlsx");

const json = [
  {
    A1: "2020-01-04",
    A2: "English",
  },
  {
    A1: "2020-01-04",
    A2: "中文",
  },
];

const book = xlsx.utils.book_new();
const sheet = xlsx.utils.json_to_sheet(json);
xlsx.utils.book_append_sheet(book, sheet, "sheet1");
xlsx.writeFile(book, "./test.dbf", {bookType: "dbf"});
A1 A2

1 | 2020-01-04 | English
2 | 2020-01-04 | __

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions