Open onyxfish opened 15 years ago
According to this: http://www.webmonkey.com/tutorial/Get_Started_With_JSON
It looks like quotes just need to be escaped for the string to remain valid Javascript. I haven't found any indications that there are other problem characters, either for JSON or for CouchDB. We should probably make this standard practice for all text fields.
So as a rule escape all string fields regardless. PHP - addslashes() within the scraper.
I will create a _escape_str() method for the PHP abstract class.
Sounds good. I'm going to see if couchdb-python is already doing this and if not I'll escape all the strings myself.
I can't find a canonical reference on this issue, but it looks like we need to be careful to escape in single or double quotes in our strings. I'm not sure, but I think the Python library might already be handling this. Need a standard approach so that data is not lost (however minor) is not lost.