Skip to content

split chinese characters to �� #2084

Open
@ruomuc

Description

@ruomuc

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch exceljs@4.3.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/exceljs/lib/stream/xlsx/workbook-reader.js b/node_modules/exceljs/lib/stream/xlsx/workbook-reader.js
index c7598d3..bd16240 100755
--- a/node_modules/exceljs/lib/stream/xlsx/workbook-reader.js
+++ b/node_modules/exceljs/lib/stream/xlsx/workbook-reader.js
@@ -185,6 +185,10 @@ class WorkbookReader extends EventEmitter {
     let richText = [];
     let index = 0;
     let font = null;
+    
+    // it will split chinese characters to ��
+    entry.setEncoding('utf-8')
+    
     for await (const events of parseSax(iterateStream(entry))) {
       for (const {eventType, value} of events) {
         if (eventType === 'opentag') {

This issue body was partially generated by patch-package.

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