How is it possible to display non-printable characters in an SWT StyledText widget in a way it's done by Swing with an empty square?
To replace all occurrences with a symbol via regex in the source string can't be the solution because copy & paste with the original codepoint won't be possible anymore.
The best way might be to intercept the text rendering and replace them there, but that seems to open Pandora's box...
Edit 1:
The control characters, it's all about, are characters that are normally just skipped and not shown by the editor like HOP (U+0081)
For an E4 RCP application I have attached some code to start with.
Basically is uses the IEventBroker to add/remove the painter of the TextViewer by means of a button.
The StyledText can be obtained from
as commented above
Handler Class
Contants interface: