View Single Post
Old 10-19-2012, 02:35 AM   #9
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
Quote:
Originally Posted by chaley View Post
Apparently the Win7 CLI does not strip single quotes from arguments, making the JSON string invalid. The following works.
Code:
--display="{\"date_format\":\"MM/dd/yy\"}"
while this doesn't:
Code:
--display='{\"date_format\":\"MM/dd/yy\"}'
So, the solution for Win7 is to use double quotes and escape all internal quotes.
Cool, that works great. Thanks! Might want to add this bit of info to the documentation. By the way, same issue exists and solution works with Windows XP. Alas, I've just never been able to capture the whole error message in XP as the batch file terminates directly after the first calibredb run (known issue, problem with Windows XP so can't fix so I just use the start workaround).

Funnily enough, I tried:
Code:
--display="{'date_format':'MM/dd/yy'}"
and:
Code:
--display='{\"date_format\":\"MM/dd/yy\"}'
I thought I had also tried:
Code:
--display="{\"date_format\":\"MM/dd/yy\"}"
but apparently not.
ilovejedd is offline   Reply With Quote