![]() |
#1 |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Making "invisible"characters visible?
If I use characters such as ZWNJ or soft hyphens, I insert them as numeric entities &#xxx; in the text. However, the "smarten punctuation" tools replaces them by the actual characters, which are invisible. It is then impossible to find them and change them. My solution so far has been to leave out the hash marks (so "&xxx;" instead of "&#xxx;"), smarten the punctuation, and then re-insert the hash marks.
I have also come across similar problems in books which already contain invisible characters which mess up my formatting, and the only way I've found to deal with them is to paste the offending text into an old 8-bit-character editor (which displays any 16-bit characters as a question mark) so I can locate them, then go back to the Calibre editor and retype the text around the problem characters to delete them. Would it be possible to change things somehow so that these "invisible" characters (which include others apart from zwnj and soft-hyphen, but I don't have a list) are always displayed as numeric entities in the editor to make them visible? |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,153
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
This is not something I am willing to do. Its adds a lot of overhead (entites are replaced by characters at parsing stage in calibre so pretty much every automated action/tool will have this effect) for everyone for a relatively uncommon use case. I suggest you just create a couple of saved search and replace expressions, that substitute the characters with the entities. Then you can go from character->entity at the click of a button or two.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
|
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,153
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Using the Find expression
\u200c (regex mode) works for me. |
![]() |
![]() |
![]() |
#5 |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Ah. Of course. Thank you.
For anyone who's interested, the following regex-function replaces all matched characters with numeric entities: Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs): result = '' for c in match.group(): result += '&#%d;' % ord(c) return result Last edited by Phssthpok; 02-11-2016 at 02:16 PM. |
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
PDF to WORD/HTML conversion, "special characters and marks" errors | chengyibo | 3 | 11-06-2010 12:43 AM | |
Free - J.J. Luna's "How To Be Invisible". | uRwhatUr | Deals and Resources (No Self-Promotion or Affiliate Links) | 6 | 01-30-2010 12:11 AM |
UNUSEABLE free e-book "Invisible Armies" by Jon Evans on HarperCollin | kacir | Reading Recommendations | 5 | 05-23-2008 06:26 PM |