Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excel file containing ESCAPE character not opening in Microsoft Excel viewer #70

Open
sudipta1411 opened this issue Mar 18, 2020 · 2 comments

Comments

@sudipta1411
Copy link

Hello,
I am exceuting the following code
var config = {"filename":"general-ledger-Q1","sheet":{"data":[[{"value":"Income - Webshop","type":"string"},{"value":"You have 3 missed Call\u001b<s\u001b> from +1234123412 Last call: 05-11-2019 11:56 ","type":"string"}]]}}; zipcelx(config)

The generated XLSX file is not opened in Microsoft Excel Viewer, whereas it is opening in Google docs and WPS Office. I am guessing the presence of \u001b (ESCAPE) character is the root of the problrm. Any idea what to do?
Thanks

@catamphetamine
Copy link

Note to devs:

One could decode "escape characters" like this:

import unraw from "unraw";

let step1 = unraw('http\\u00253A\\u00252F\\u00252Fexample.com');
// yields "http%3A%2F%2Fexample.com"
// Then you can use decodeURIComponent to further decode it:
let step2 = decodeURIComponent(step1);
// yields http://example.com

@catamphetamine
Copy link

@sudipta1411 How did "escape characters" end up in your data in the first place?
Perhaps you should first unraw() it and then call this library's functions.

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

No branches or pull requests

2 participants