I have this software that generates HTML and saves it to gridfs.
I noticed that my static pages that went through this process were having its special characters such as à and ã corrupted.
I ended fixing it by checking if the incoming data that was going to be written to gridfs was a string and converting it to a buffer using the string and indicating utf-8 as the charset.
Is that intended, is the default charset being used is not utf-8?
if (typeof (data) === 'string') {
data = new Buffer(data, 'utf-8');
}
gs.write(data, true, function wroteData(error) {
callback(error);
});Enter code here...