Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 02-09-2023, 01:07 PM   #1
Steven Bennett
Junior Member
Steven Bennett began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2023
Location: Bentham, UK
Device: Kobo Libra 2
Eliminate spurious spaces after apostrophes

Many epub books use an apostrophe such as ’ which is hex 92 and is called Right single quotation mark, it causes ereaders like Kobo to insert a spurious space after the character. The solution is to replace all hex 92 character with the hex 27 character and is called Single quote.

To do this:

1: Download and install the epub editor Sigil from https://sigil-ebook.com/sigil/download/

2: Open Calibre to view books in library.

3: Right click an affected book and choose Open Containing Folder.

4: Right click the .epub file and choose open with Sigil (or The Calibre epub Editor is very similar).

5: Often the following message will appear, allow Sigil to fix the epub file:

This EPUB has HTML files that are not well formed or are missing a DOCTYPE, html, head or body elements. Sigil can automatically fix these files, although this may very rarely result in minor data loss in extreme circumstances.

6: The book will open in Sigil and show various files such as title, jacket and a number of chapter files.

7: On the menu bar click Search > Find & Replace.

8: At the bottom of the window copy ’ from this line and paste into the Find box, then copy ' and paste into the Replace box.

9: Ensure that the middle drop down is changed to All HTML files so the find and replace will process all individual HTML files.

10: Observe that hundreds or thousands of replacements have been made.

11: On the File menu Save the file, which will overwrite the original with the modified file.

12: Plug in USB cable to Kobo reader, at message Computer detected touch Connect.

13: The Kobo Reader drive will open showing various files and folders - just minimise or close.

14: Select the modified book and it will highlight in blue.

15: Click the Send to device button - blue arrow.

16: On the Device button choose and click Eject Device then unplug the Kobo reader.

17: Open corrected book in Kobo reader and check the there are no spaces after apostrophes (now single quotes).
Steven Bennett is offline   Reply With Quote
Old 02-09-2023, 01:47 PM   #2
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,169
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Um, no, for English:
Right quote is ’ U+2019, it's used also for apostrophe in English.
Left quote is ‘ U+2019
Web pages sometimes use HTML entities, but UTF8 epub can use them directly.

There is usually end of paragraph or a space after ’ (right quote) unless it’s an apostrophe as in ’90s or won’t.
https://unicode-table.com/en/sets/quotation-marks/

Unicode Hex Character Code &#x92 is "Private use two" and should not be used as ’. It should be replaced with Right quote ’ U+2019, which in English doubles as the apostrophe.


Unicode Hex Character Code &#x92 is ' and is the typewriter apostrophe or programming single quote. It should only be in ebooks in code examples or simulation of typewriters, consoles, DOS, teleprinters and telex messages.
Same applies to ", it's the programming double quote and it also should only be in ebooks in code examples or simulation of typewriters, consoles, DOS, teleprinters and telex messages.

the `should never be in English as left quote it's for à è etc.

2' 7" or 2’ 7” are wrong, the prime and double prime should be used 2′ 7″ for feet & Inches or minutes & seconds (time or angular degrees)

Also make clear if you mean Unicode or ASCII, but obviously you mean Unicode.

The Microsoft Windows code page CP1252 (sometimes incorrectly called ANSI or ISO-Latin) contains the typographic apostrophe at 0x92, which is why the ’ might be displayed for Unicode Hex Character Code &#x92. But Unicode uses U+2019 for apostrophes (also the English closing or right quote)
See https://en.wikipedia.org/wiki/Apostr...ng_apostrophes

Last edited by Quoth; 02-09-2023 at 02:00 PM.
Quoth is offline   Reply With Quote
Advert
Old 03-22-2023, 02:46 PM   #3
ucousedas
Junior Member
ucousedas began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Mar 2023
Device: Kobo Elipsa
Hi, I have the same issue on my Kobo Elipsa with the converted EPUBs.
Is there a better way to fix this issue? (Without modifying the original EPUBs?)
Maybe some settings inside KoboTouch Extended Driver plugin?
ucousedas is offline   Reply With Quote
Old 03-23-2023, 04:13 PM   #4
Sarmat89
Evangelist
Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.
 
Posts: 482
Karma: 2267928
Join Date: Nov 2015
Device: none
Typographic apostrophes are unfortunate because they are not connecting punctuation, and the words can (and will) be broken after it.
Sarmat89 is offline   Reply With Quote
Old 03-27-2023, 06:54 AM   #5
Steven Bennett
Junior Member
Steven Bennett began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2023
Location: Bentham, UK
Device: Kobo Libra 2
Quote:
Originally Posted by Quoth View Post
Um, no, for English:
Right quote is ’ U+2019, it's used also for apostrophe in English.
Left quote is ‘ U+2019
Web pages sometimes use HTML entities, but UTF8 epub can use them directly.

There is usually end of paragraph or a space after ’ (right quote) unless it’s an apostrophe as in ’90s or won’t.
https://unicode-table.com/en/sets/quotation-marks/

Unicode Hex Character Code &#x92 is "Private use two" and should not be used as ’. It should be replaced with Right quote ’ U+2019, which in English doubles as the apostrophe.


Unicode Hex Character Code &#x92 is ' and is the typewriter apostrophe or programming single quote. It should only be in ebooks in code examples or simulation of typewriters, consoles, DOS, teleprinters and telex messages.
Same applies to ", it's the programming double quote and it also should only be in ebooks in code examples or simulation of typewriters, consoles, DOS, teleprinters and telex messages.

the `should never be in English as left quote it's for à è etc.

2' 7" or 2’ 7” are wrong, the prime and double prime should be used 2′ 7″ for feet & Inches or minutes & seconds (time or angular degrees)

Also make clear if you mean Unicode or ASCII, but obviously you mean Unicode.

The Microsoft Windows code page CP1252 (sometimes incorrectly called ANSI or ISO-Latin) contains the typographic apostrophe at 0x92, which is why the ’ might be displayed for Unicode Hex Character Code &#x92. But Unicode uses U+2019 for apostrophes (also the English closing or right quote)
See https://en.wikipedia.org/wiki/Apostr...ng_apostrophes
Thanks for all that info, I'll try some of your suggestions, however my simple fix provides a perfect solution for the various problems I have been having with the Kobo reader.
Steven Bennett is offline   Reply With Quote
Advert
Old 06-02-2023, 02:06 PM   #6
TheSmitty
Addict
TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.
 
TheSmitty's Avatar
 
Posts: 224
Karma: 1181422
Join Date: Dec 2017
Location: DFW, TX area
Device: Paperwhite SE, Libra 2, Oasis 3, Boox Note Air 3C, iPad Pro 11
I side loaded a book via calibre (using kobo extended touch) and the book has this problem. Problem being extra spaces after an apostrophe (example It' s instead of It's). It is a Kobo epub on my device. Very annoying. Seems to be the same for all side loaded books. Any help?
TheSmitty is offline   Reply With Quote
Old 06-02-2023, 04:29 PM   #7
issybird
o saeclum infacetum
issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.
 
issybird's Avatar
 
Posts: 20,234
Karma: 222235366
Join Date: Oct 2010
Location: New England
Device: H2O, Aura One, PW5
^^Please don't crosspost.
issybird is offline   Reply With Quote
Old 06-02-2023, 04:56 PM   #8
TheSmitty
Addict
TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.
 
TheSmitty's Avatar
 
Posts: 224
Karma: 1181422
Join Date: Dec 2017
Location: DFW, TX area
Device: Paperwhite SE, Libra 2, Oasis 3, Boox Note Air 3C, iPad Pro 11
Sorry, was looking for help beyond editing all the books. Guess there is no help.
TheSmitty is offline   Reply With Quote
Old 06-02-2023, 06:02 PM   #9
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,104
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by TheSmitty View Post
I side loaded a book via calibre (using kobo extended touch) and the book has this problem. Problem being extra spaces after an apostrophe (example It' s instead of It's). It is a Kobo epub on my device. Very annoying. Seems to be the same for all side loaded books. Any help?
I am sure I responded in your other thread. I guess that thread was removed as a duplicate.

Open the ebook in the Calibre editor and check the spacing there. Is there additional spacing?

I guess whoever edited the ebook made a boo-boo with a regex and added an extra space.

You could remove it with a regex, something like...

Find ... ’\s(\w)\s
Replace ... ’\1 (with a space after the \1)

You might need to modify it so it takes into account commas or periods after the s.

Check the type of apostrophe in the regex matches the one used by the ebook.

Last edited by Karellen; 06-02-2023 at 06:18 PM.
Karellen is online now   Reply With Quote
Old 06-02-2023, 08:41 PM   #10
TheSmitty
Addict
TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.TheSmitty ought to be getting tired of karma fortunes by now.
 
TheSmitty's Avatar
 
Posts: 224
Karma: 1181422
Join Date: Dec 2017
Location: DFW, TX area
Device: Paperwhite SE, Libra 2, Oasis 3, Boox Note Air 3C, iPad Pro 11
Quote:
Originally Posted by Karellen View Post
I am sure I responded in your other thread. I guess that thread was removed as a duplicate.

Open the ebook in the Calibre editor and check the spacing there. Is there additional spacing?

I guess whoever edited the ebook made a boo-boo with a regex and added an extra space.

You could remove it with a regex, something like...

Find ... ’\s(\w)\s
Replace ... ’\1 (with a space after the \1)

You might need to modify it so it takes into account commas or periods after the s.

Check the type of apostrophe in the regex matches the one used by the ebook.

Thank you
TheSmitty is offline   Reply With Quote
Old 09-10-2023, 08:32 PM   #11
mikeana
Junior Member
mikeana began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2012
Device: kindle
Cool Kobo problems with accents, tildes and apostrophies.

Quote:
Originally Posted by ucousedas View Post
Hi, I have the same issue on my Kobo Elipsa with the converted EPUBs.
Is there a better way to fix this issue? (Without modifying the original EPUBs?)
Maybe some settings inside KoboTouch Extended Driver plugin?

I can understand the logic of correcting the errors, but why is it that my side loaded books on my kindle keyboard don't have this problem but the same mobi or e-pub(converted) file side loaded into Kobo Libra 2 gives this problem?
It is even worse with Spanish books which have accents and tildes. I have half of my books in Spanish and I can hardly read them because most lines have accents. But they work fine in Kindle. Is Kobo or e-pubs more delicate or are Kindles more forgiving?
There should be an easier way to fix hundreds of books?
Thanks

Sept. 12
After hours of experimenting with all your help but not solving my problem, I decided to try a factory reset, and Wow. Problem solved. Apparently the data base must have been contaminated after so much experimenting, and was doing strange things. As I said, it was not logical for the files to work everywhere else and not on the Kobo.
Well. I learnt something the hard way, and hope this will be of some use to others.
Thanks again for all the help on this forum.
September 19th
I feel ashamed to admit this, but I feel it might happen to someone else. I was using the "AR UD Jingxihel" font which worked in English, but when in Spanish does not recognize the accents and tildes. There really was no indication that this format was for Chines language until I looked it up on the internet.
Thanks

Last edited by mikeana; 09-19-2023 at 01:37 PM. Reason: Problem finaly solved.
mikeana is offline   Reply With Quote
Old 11-16-2023, 03:31 AM   #12
maddz
Wizard
maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.
 
Posts: 1,273
Karma: 28630044
Join Date: Mar 2010
Location: UK
Device: Kobo Forma, Icarus, iPad Mini 2, Kobo Touch, Google Nexus 7
I'm having the same problem with apostrophes, and additionally accented characters have extra white space. Books are fine in the Calibre viewer and the Calibre editor, but I get all this extra white space on my Forma.

I'd like to avoid a factory reset if possible as it'll take several days to sideload my library.
maddz is online now   Reply With Quote
Old 11-17-2023, 06:08 AM   #13
maddz
Wizard
maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.maddz ought to be getting tired of karma fortunes by now.
 
Posts: 1,273
Karma: 28630044
Join Date: Mar 2010
Location: UK
Device: Kobo Forma, Icarus, iPad Mini 2, Kobo Touch, Google Nexus 7
Quote:
Originally Posted by maddz View Post
I'm having the same problem with apostrophes, and additionally accented characters have extra white space. Books are fine in the Calibre viewer and the Calibre editor, but I get all this extra white space on my Forma.

I'd like to avoid a factory reset if possible as it'll take several days to sideload my library.
Fixed this by changing the reader default font. Rakuten Sans works and is clear; the AR UDJingxihei font introduces the spurious spaces. For some reason, most books were defaulting to the latter.
maddz is online now   Reply With Quote
Reply

Tags
apostrophe, eliminate, factory reset, spaces


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regex expression to replace certain spaces with nonbreaking spaces Dashcroft Sigil 3 12-10-2022 08:01 PM
Overdrive - spurious page turns dmacmart Kobo Tablets 5 11-21-2011 10:32 AM
Spurious by Lars Iyer wallcraft Deals and Resources (No Self-Promotion or Affiliate Links) 1 08-18-2011 09:32 PM
PDF to EPUB - spurious paragraph breaks RichieTheK Calibre 2 09-08-2010 11:27 AM
Spurious Line Breaks Halk Workshop 1 05-15-2010 01:22 PM


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


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