Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 02-01-2011, 03:50 PM   #1
Rajmahid
Enthusiast
Rajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with others
 
Posts: 34
Karma: 2584
Join Date: Jan 2011
Device: Kindle
"backward" smart quotes problem

I just encountered, for the first time, an issue with quotation marks appearing inverted -- that is close quotes -- at the BEGINNING of a number of sentences in an ePub when I ran it through Calibre's "smarten punctuation" option. Whether converting to Mobi or just trying to smarten the punctuation marks in the original ePub in question, both formats keep giving the same "backward quote" results.

The book (public domain, reformatted and tweaked by a member here) to which I'm referring was obtained in the ePub books Humor section of the MobileRead Forum, and can be found at this link:

http://www.mobileread.com/forums/sho...+lucia+omnibus

I examined the ePub using Sigl's code view, but saw nothing obviously wrong. Any help with this perplexing issue would be greatly appreciated.
Rajmahid is offline   Reply With Quote
Old 02-01-2011, 03:54 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,312
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That can happen if the book has unbalanced quotes. i.e. an odd number of "
kovidgoyal is offline   Reply With Quote
Old 02-01-2011, 04:05 PM   #3
Rajmahid
Enthusiast
Rajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with others
 
Posts: 34
Karma: 2584
Join Date: Jan 2011
Device: Kindle
Quote:
Originally Posted by kovidgoyal View Post
That can happen if the book has unbalanced quotes. i.e. an odd number of "
Thanks for your very quick reply -- but could you clarify that "odd number of" for me? I'm not sure I follow you. An example would help.

Much appreciated!
Rajmahid is offline   Reply With Quote
Old 02-01-2011, 04:05 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,312
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
"some text, "some quoted text"
kovidgoyal is offline   Reply With Quote
Old 02-01-2011, 04:16 PM   #5
Rajmahid
Enthusiast
Rajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with others
 
Posts: 34
Karma: 2584
Join Date: Jan 2011
Device: Kindle
Quote:
Originally Posted by kovidgoyal View Post
"some text, "some quoted text"
I must be wearing my stupid cap today, or just missed the point entirely. The quotes throughout the ebook seem consistently balanced -- i.e. nothing like you just pointed out. I'm attaching a screen capture of a typical page with the quotes issue and would be ecstatic if you could tell me if they seem unbalanced -- as I understand your example.

Better yet, here's a link to the ePub in question from MobileRead forum...if you have a few seconds, run it through Calibre's "smarten quotation" to see the dismal results:

http://www.mobileread.com/forums/att...4&d=1266764614

And if you have a suggestion to any editing or reformatting I might engage in with something like Sigil, please let me know.

Sorry to be such a nuisance
Attached Thumbnails
Click image for larger version

Name:	Quoted_text.jpg
Views:	195
Size:	245.6 KB
ID:	65885  

Last edited by Rajmahid; 02-01-2011 at 04:19 PM.
Rajmahid is offline   Reply With Quote
Old 02-01-2011, 04:22 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,312
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You have to look through the entire document for unbalanced quotes, a particular section doesn't matter, once there is an unbalanced quote, all the remaining quotes become messed up.
kovidgoyal is offline   Reply With Quote
Old 02-01-2011, 04:26 PM   #7
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 644
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD
I opened the epub in sigil and done a search-count for quotes just in the first chapter - was 79, so a quote is missing from a paragraph somewhere (or from several).
(just because there may be an even number, doesn't guarantee they're matching pairs)

Use Sigil, and do a search for a quote mark, then just keep looking for the next one, and try to spot any sentences where one is missing, either from the beginning or end of speech/quote etc., then when you find one missing, add it, continue till you're happy.

Edit:
So continue through rest of book.

Last edited by Perkin; 02-01-2011 at 04:28 PM. Reason: missed kovid's post while typing
Perkin is offline   Reply With Quote
Old 02-01-2011, 04:37 PM   #8
Rajmahid
Enthusiast
Rajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with others
 
Posts: 34
Karma: 2584
Join Date: Jan 2011
Device: Kindle
Quote:
Originally Posted by kovidgoyal View Post
You have to look through the entire document for unbalanced quotes, a particular section doesn't matter, once there is an unbalanced quote, all the remaining quotes become messed up.
Ahhhh.... Of course, one unbalanced quote messes it up for the rest of them! Good old html.....

Thank you and Perkin for your assistance!
Rajmahid is offline   Reply With Quote
Old 02-03-2011, 09:41 AM   #9
bfollowell
Fanatic
bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.
 
Posts: 515
Karma: 1152752
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Amazon Kindle 3 Wi-Fi & B&N Nook Tablet & B&N Nook HD+
Quote:
Originally Posted by kovidgoyal View Post
You have to look through the entire document for unbalanced quotes, a particular section doesn't matter, once there is an unbalanced quote, all the remaining quotes become messed up.
While this is mostly true, it isn't always necessarily the case. I've had Calibre convert a regular quote to the wrong smart quote and THAT was the only one that was off. In other words, there wasn't an imbalance until the one was incorrectly converted. I don't think this just happens our of the blue though. It almost always happens on a rare sentence or paragraph that starts with an open quote and then an em dash. I think this just confuses the conversion engine but I'm not sure why.

At least this has been my experience.

- Byron
bfollowell is offline   Reply With Quote
Old 02-03-2011, 11:00 AM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,312
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Open a ticket and attach a test case demonstrating this behavior.
kovidgoyal is offline   Reply With Quote
Old 02-03-2011, 11:11 AM   #11
bfollowell
Fanatic
bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.
 
Posts: 515
Karma: 1152752
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Amazon Kindle 3 Wi-Fi & B&N Nook Tablet & B&N Nook HD+
Quote:
Originally Posted by kovidgoyal View Post
Open a ticket and attach a test case demonstrating this behavior.
Will do. I haven't been too concerned with it since it happens so rarely. I'll keep an eye out for another occurrence and will open a ticket once I have a good example.

- Byron
bfollowell is offline   Reply With Quote
Old 02-05-2011, 04:05 PM   #12
Rylon
Hungry Polar Bear
Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.
 
Rylon's Avatar
 
Posts: 33
Karma: 355562
Join Date: Feb 2011
Location: San Jose, CA
Device: Kindle Keyboard Wi-Fi + 3G
Here's an alternate solution

Rather than using calibre's smart quotes option, I decided to go old school and use sed. I wrote a sed script that does a good job of creating html smart quotes.

I'm attaching the file, to use it type
Code:
sed -f qscript.txt input file > output file
at a unix command prompt.

Note, as is, this script only works with GNU Sed. To get it to work with other versions of sed, simply remove all the comments aside from the first one.

What you'll end-up with is a file that uses escaped quotations using the numeric character reference. It'll also handle apostrophes and m-dashes. The script has been tested and used only on text files I got from Project Gutenberg and converted to html.

This script has a tendency to be under-inclusive. I suggest that you open up the new file and do a search for double and single quotes. If there aren't a lot, you can manually change them. If there are a lot, I dunno.
Attached Files
File Type: txt qscript.txt (1.1 KB, 93 views)

Last edited by Rylon; 02-05-2011 at 04:46 PM. Reason: Whoops, forgot a step in adding the attachment.
Rylon is offline   Reply With Quote
Old 02-05-2011, 04:16 PM   #13
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 64,805
Karma: 42802537
Join Date: Nov 2006
Location: UK
Device: Kindle Voyage, iPad Mini, iPhone 4, MS Surface Pro, N7
Where is the attachment?
HarryT is online now   Reply With Quote
Old 02-05-2011, 04:48 PM   #14
Rylon
Hungry Polar Bear
Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.Rylon ought to be getting tired of karma fortunes by now.
 
Rylon's Avatar
 
Posts: 33
Karma: 355562
Join Date: Feb 2011
Location: San Jose, CA
Device: Kindle Keyboard Wi-Fi + 3G
Quote:
Originally Posted by HarryT View Post
Where is the attachment?
Apparently, still on my computer wondering why it hasn't been uploaded yet.
Rylon is offline   Reply With Quote
Old 02-06-2011, 05:06 PM   #15
Rajmahid
Enthusiast
Rajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with othersRajmahid plays well with others
 
Posts: 34
Karma: 2584
Join Date: Jan 2011
Device: Kindle
Wish I had a script for Windows...it's a painstaking operation doing a search & replace for the quotes in the Lucia Omnibus You'd think only a few chapters would suffer from this weird phenomenon that Calibre can't deal with, but it's ALL of them. 12 chapters are complete -- only 81 (!!!) to go.

The only relief is that I only have to manually fix the front-end quotes, Calibre correctly transforms the end-sentence smart quotes.
Rajmahid is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"A Problem Occurred" on the "Shop" page. swallman Nook Color & Nook Tablet 1 12-25-2010 01:34 PM
Sudden Problem with "The" and "A" Titles Otter Calibre 13 09-05-2010 09:32 PM
Engadget:Toshiba Shows off "Smart Pad" promises launch before October kjk News 3 07-20-2010 08:18 PM
Classic Australian Daily Telegraph "Smart Edition" and the nook? firefox Barnes & Noble NOOK 0 07-19-2010 03:50 AM
An explanation for the "Oops, We're Working On Your problem," page at the Sony Store Dr. Drib Sony Reader 2 07-25-2009 08:40 AM


All times are GMT -4. The time now is 01:07 PM.


MobileRead.com is a privately owned, operated and funded community.