02-10-2020, 05:58 PM | #1 |
Junior Member
Posts: 4
Karma: 10
Join Date: Feb 2020
Device: Supernote A6
|
How to find and replace text?
Due to some issues with my ereader, I have to format the quote marks on my ebooks to be straight (') and not curly (’). Some of my ebooks have the curly quote marks (’) by default, and I am wondering if there is a quick way in calibre to find and replace all of the curly quotes with straight ones. I noticed there is a tool called "smarten punctuation" but it does the opposite of what I need it to do.
Any ideas? |
02-10-2020, 06:17 PM | #2 |
Running with scissors
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
|
Select the book in Calibre. Tap the t key to open it in the editor. In the editor in the left column double click on the file for the first chapter where you want it to start; it will fix all following chapters as well. In the big pane where the chapter contents is find the first quote and drag over it to select it (and only it). Then do control F and that will bring up the search and replace box below. The quote you selected will be filled in in the Find: box. In the Replace: box type in the replacement quote. In the mode line below change the drop down to All text files; the third drop down should be Down. Click on the Replace All button. Repeat for the other quote.
Keep your fingers crossed and hope it doesn't screw anything up in the html header at the top; the stuff with angle brackets. |
Advert | |
|
02-10-2020, 07:06 PM | #3 |
Junior Member
Posts: 4
Karma: 10
Join Date: Feb 2020
Device: Supernote A6
|
Worked, thank you
|
02-13-2020, 09:08 PM | #4 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
That will convert your book and change all smart quotes into their dumb equivalents. May I ask what the exact issue is? |
|
02-14-2020, 09:46 AM | #5 |
Junior Member
Posts: 4
Karma: 10
Join Date: Feb 2020
Device: Supernote A6
|
The ereader (supernote) is primarily used in Chinese and Japanese so there's still a few bugs with the english version. For some reason theres always a space after every smart apostrophe or quote mark, it started getting kind of annoying so I decided to figure out some way to fix it.
|
Advert | |
|
02-14-2020, 06:11 PM | #6 | ||||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Are your books marked with the proper language lang + xml:lang in the HTML? Code:
<html lang="en" xml:lang="en"> And what exact ereader is this? Does it happen if you embed/use a different font to display your ebook? Quote:
For example, see Wikipedia article on "Chinese Punctiaton": Quote:
https://answers.microsoft.com/en-us/...9b31bf5&page=6 I remember seeing LibreOffice locale bugs about similar things over the years too. If I remember correctly, it's usually something along these lines: "Computer/OS/Program set to Asian language, trying to type book in English. Program/Font is still making Asian typography assumptions." Technical Note: It could also be built into the OpenType fonts in your device itself... there are OpenType features like: Quote:
Spoiler:
which is why I suggest embedding a different font and seeing if that works. Last edited by Tex2002ans; 02-14-2020 at 06:36 PM. |
||||
02-14-2020, 06:58 PM | #7 |
Junior Member
Posts: 4
Karma: 10
Join Date: Feb 2020
Device: Supernote A6
|
Thanks for the info. Here's the website of the product. I actually contacted them and they said they would create a new font on the device that would fix the issue by the end of the month. For now it's easy enough just to unsmarten the punctuation because it fixes the spacing. Changing the font in Calibre doesn't seem to affect anything because the device seems to use its own fonts. I'll keep experimenting, I'm still very new to editing ebooks and understanding the html and such.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Behaviour of history and spaces in find/replace text boxes | arspr | Editor | 0 | 01-01-2014 05:04 PM |
Find/Replace text into both dialog boxes | Steadyhands | Sigil | 5 | 02-25-2013 02:51 PM |
Find/Replace Won't Find | Rand Brittain | Sigil | 7 | 09-24-2011 04:35 AM |
Need Text editor for specific Find/Replace Regular Expression | scubaddictions | Workshop | 11 | 08-17-2011 07:58 PM |
Find/Replace bogus line breaks in Text editor, w/Regular Expression | scubaddictions | Conversion | 15 | 07-21-2011 08:52 AM |