Curly quotes in JSON

Word processors, notes apps and chat apps often turn straight quotes into curly ones, also called smart quotes: “ and ” instead of ". They look almost the same, but they're different characters, and JSON only accepts the straight double quote (U+0022) around strings. JSON copied from a document, a slide or a chat message is the usual cause.

In Chrome and Node.js, JSON.parse says: Expected property name or '}' in JSON

Broken
{
  “name”: “Ada Lovelace”,
  “born”: 1815
}
Fixed
{
  "name": "Ada Lovelace",
  "born": 1815
}

Fix it by hand

Replace each “ and ” around keys and text with a straight ". Find and replace in a code editor does it in one pass.

Open this example in j2n