Skip to main content
deleted 64 characters in body
Source Link
mikemaccana
  • 125.9k
  • 113
  • 440
  • 543

Hook into you response generator or create a middleware that does the following:

res.headersetHeader("Content-Type", "application/json; charset=utf-8");

Otherwise the browser displays the content in hisit's favorite encoding.

If this doesn't help you DB is probably in the wrong encoding.

Edit:For older node.js versions Since the answer is nearly 5 years old, the API has changed. For current node.js versions use:

res.setHeaderheader("Content-Type", "application/json; charset=utf-8");

Hook into you response generator or create a middleware that does the following:

res.header("Content-Type", "application/json; charset=utf-8");

Otherwise the browser displays the content in his favorite encoding.

If this doesn't help you DB is probably in the wrong encoding.

Edit: Since the answer is nearly 5 years old, the API has changed. For current node.js versions use:

res.setHeader("Content-Type", "application/json; charset=utf-8");

Hook into you response generator or create a middleware that does the following:

res.setHeader("Content-Type", "application/json; charset=utf-8");

Otherwise the browser displays the content in it's favorite encoding.

If this doesn't help you DB is probably in the wrong encoding.

For older node.js versions use:

res.header("Content-Type", "application/json; charset=utf-8");
added 181 characters in body
Source Link
TheHippo
  • 63.3k
  • 15
  • 77
  • 101

Hook into you response generator or create a middleware that does the following:

res.header("Content-Type", "application/json; charset=utf-8");

Otherwise the browser displays the content in his favorite encoding.

If this doesn't help you DB is probably in the wrong encoding.

Edit: Since the answer is nearly 5 years old, the API has changed. For current node.js versions use:

res.setHeader("Content-Type", "application/json; charset=utf-8");

Hook into you response generator or create a middleware that does the following:

res.header("Content-Type", "application/json; charset=utf-8");

Otherwise the browser displays the content in his favorite encoding.

If this doesn't help you DB is probably in the wrong encoding.

Hook into you response generator or create a middleware that does the following:

res.header("Content-Type", "application/json; charset=utf-8");

Otherwise the browser displays the content in his favorite encoding.

If this doesn't help you DB is probably in the wrong encoding.

Edit: Since the answer is nearly 5 years old, the API has changed. For current node.js versions use:

res.setHeader("Content-Type", "application/json; charset=utf-8");
Source Link
TheHippo
  • 63.3k
  • 15
  • 77
  • 101

Hook into you response generator or create a middleware that does the following:

res.header("Content-Type", "application/json; charset=utf-8");

Otherwise the browser displays the content in his favorite encoding.

If this doesn't help you DB is probably in the wrong encoding.