escaping special characters during export?

Talk to other Pedia users about the programs, share tricks and tips or ask questions about existing features.
Post Reply
maik
Contributor
Contributor
Posts: 8
Joined: Sun Sep 28, 2008 4:17 pm
Location: Eltville, Germany

escaping special characters during export?

Post by maik »

Hi,

does someone know how I can escape characters like single-quote (') or double-quote (") in my exported data? The text in my summary field frequently contains these characters and they mess up my JSON...

Cheers,
-Maik
User avatar
Conor
Top Dog
Posts: 5346
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: escaping special characters during export?

Post by Conor »

If your using a text template export then use an Automator action to find and replace the quotes. The pedias do encoding for HTML but this is not the same as the JSON escape done with back-slash.

P.S. The only character from your set than needs escaping is the double quote, single quote is okay. See sidebar under char heading.
maik
Contributor
Contributor
Posts: 8
Joined: Sun Sep 28, 2008 4:17 pm
Location: Eltville, Germany

Re: escaping special characters during export?

Post by maik »

Hi Conor,

thanks, that's a viable alternative. I have also been thinking of querying the DB from an external application and then doing my own export. Is this a dumb idea? According to the documentation at sqlite.org multiple applications can query the same DB at the same time, so I guess I wouldn't even have to make sure that DVDpedia is not running, right? Also, I believe I should be able to find updated entries by querying the ZENTRY.ZDATEEDITED value and then update entries in my data based on the Z_PK value (or is it ZUID)?

I'm asking all this because I am currently toying around with creating a WebApp export for iPhone and am looking for an easy way to make the data available before uploading it to e.g. MobileMe.

Cheers,
-Maik
User avatar
Conor
Top Dog
Posts: 5346
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: escaping special characters during export?

Post by Conor »

That will indeed work and there is no need to quit DVDpedia especially since with read only operations on the database. Both the Z_PK and ZUID will work. The first is the internal Core Data ID while the second is our own unique ID. The second one has the advantage that it's also the cover image name, if you want automate copying those over as well.
Post Reply