zipcelx icon indicating copy to clipboard operation
zipcelx copied to clipboard

Excel file containing ESCAPE character not opening in Microsoft Excel viewer

Open sudipta1411 opened this issue 5 years ago • 2 comments
trafficstars

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

sudipta1411 avatar Mar 18 '20 09:03 sudipta1411

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 avatar Jun 09 '21 22:06 catamphetamine

@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.

catamphetamine avatar Jun 09 '21 22:06 catamphetamine