I'm parsing a CSV text file containing some data (with labels, numbers, symbols, ...) using XLSX. At some point, my data are parsed and one of the cell content is '\x80', which is the unicode code of the euro symbol.
const s = "\x80"
console.log({ s }) // => {s: '\x80'}
console.log(s) // => €
When I try to save this variable into my database (Mongodb), it is not recognized as €.
s.replace("\x80", "€")
is not a solution for me because some other special characters can showed up while importing files.
How can I convert "\x80" to "€" ?
I try some solutions like unescape( encodeURIComponent( s ) );
but none of them worked.
Edit
XLSX is a library to work with Excel files https://github.com/SheetJS/sheetjs.
Original encoding of the file is windows-1252
Edit 2
It look like it's a browser problem \x80
is working on Chrome but not on Safari nor Firfox.
console.log(s) // Print empty string on Safari => ""
Edit 3
I have created this codebox to reproduce