I am using node.js with express. I read out data from MongoDB with Mongoose and deliver it the normal way with res.send(data). Unfortunately the delivering fails for some requests. Even so the header says the encoding is utf-8, it seems to be ANSI in some cases, causing the jsonp callback function to fail with an error.
You can reproduce the error at this page: http://like-my-style.com/#!single/9837034 . The jsonp call fails just on some products, most of them (also the ones with special chars) work fine.
How can I ensure, that a given String is encoded in utf-8 in node.js?
Have you tried:
To ensure that your data is in utf8 and is not Buffer.