1

I need to edit text files that contain unicode characters (in ReStructuredText for input to Sphinx). I'm pretty confident that most text editors will store and display most Unicode characters correctly, but one, the zero-width space (U+200B), is a problem.

If you're not familiar with this character, it's like a discretionary hyphen without the hyphen. That is, if it falls within a line, it's invisible. If it falls at a point that's a candidate for a line break it allows the break, but it still is invisible. (There's no hyphen, or any other additional character, at the end of the line.)

I need this in long pathnames that appear in text to keep line lengths reasonably even. Without it, I'd get an extremely short line preceding a pathname that won't fit on the same line and can't be divided across the line break. For example: C:\Users\joanne\​Documents\Marketing\​​2022Q1\WesternRegion\​​overall_plan_working_copy.odf. Or ~/git/vendors/​​CompuShock/AR2021C/​​transmission/tests/​​group_3/qa_test_plan.rst. (Change your browser's column width to make these pathnames fall across a line break. Imagine how the lines would look if they couldn't be broken.)

The problem is that in the editor I use, Notepad++, the ZWS displays exactly as it's supposed to look: invisible. This is fine for reading but terrible for editing. The only way to tell that a ZWS is there is to move through the text one character at a time by pressing the left or right arrow key. If you have to press the key twice to move the insert point one character left or right, it's moving across an invisible ZWS.

Setting "View > Show Symbols > Show All Characters" doesn't help. ZWS is still invisible.

In contrast, when Microsoft Word is configured to the equivalent of "Show All Characters," it displays a ZWS as a little rectangle inside a big rectangle. This or something similar would be fine if my editor would do it.

I need a way to make Notepad++ (and hopefully other text editors) display the ZWS, or a similar text editor that can do so. Any ideas?

1 Answer 1

0

I need a way to make Notepad++ (and hopefully other text editors) display the ZWS

If "show invisible characters" doesn't show it, then the tool can't show you them.

New features can be requested for many tools, you might request it.

As a workaround, you might replace all ZWSs to something visible, and after you've checked what you needed, you can change them back.

2
  • Search/replace is a potential solution, but not an attractive one. First, because it adds overhead to an operation that I want to perform frequently. Second, because I'm editing content that's written and revised by engineers. They would probably ignore the ZWSes and constantly mess them up, or even complain because they make cursor movement act funny! /// I've considered using MS Word as the text editor, but again, the engineers are unlikely to cooperate. Some aren't even willing to use Windows. Sep 19, 2021 at 9:23
  • "but not an attractive one" that's why I called it workaround Sep 19, 2021 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.