I will be launching CRYPTOSTAR.MONEY soon (“Find Rated Crypto Businesses”) which is built on WordPress.
JSON Requires Straight Quotes
I get the error shown below.
Can you see the problem?
The first double-quote is bent – it is a not the straight double-quote required by JSON. The JSON in the database is valid so the process of writing it out of the database into the page has corrupted it.
It’s a WordPress feature not a bug
You can also remove the curvy quotations from titles by adding this code:
A note on character encoding
If a JSON string won’t parse you can URI encode it to quickly detect unicode characters.
var goodQuotes = badQuotes .replace(/[\u2018\u2019]/g, "'") .replace(/[\u201C\u201D]/g, '"');
It is possible to be even more aggressive and remove all non-ascii characters from a string.