I'm using Firebase real-time database for my app. Daily backup is enabled for the database. The database contains data with accents in words such as "Manutenção".
- If I check this text in the Firebase console it is shown as "Manutenção".
- If I export the data from the Firebase console it is shown as "Manutenção".
- But if I download the backup file (.gzip) and after extraction, it is shown as "Manutenção". Notice here the encoding of accents. This encoding is according to https://string-functions.com/encodingtable.aspx?encoding=65001&decoding=10000
- Why does the .gzip backup file encode the accents?
- How to decode these encoded accents programmatically? I tried to use the node module iconv but was not able to convert it.
var Iconv = require('iconv').Iconv;
var iconv = new Iconv('macintosh', 'UTF-8');
var buffer = iconv.convert('Manutenção');
console.log(buffer.toString()); // Manutenção
- how can I get back "Manutenção" from "Manuten√ß√£o"?
Thanks!