[Not a direct answer to your question - but a useful technique nevertheless]
If you place your cursor on any character (including such "invisible characters") and do C-u C-x =
(i.e. call the command what-cursor-position
with a prefix argument, you get a help page that gives you most (all?) the information that emacs knows about the character at that position:
position: 24 of 29 (79%), column: 23
character: (displayed as ) (codepoint 160, #o240, #xa0)
charset: unicode-bmp (Unicode Basic Multilingual Plane (U+0000..U+FFFF))
code point in charset: 0xA0
script: latin
syntax: which means: whitespace
category: .:Base, b:Arabic, j:Japanese, l:Latin
to input: type "C-x 8 RET a0" or "C-x 8 RET NO-BREAK SPACE"
buffer code: #xC2 #xA0
file code: #xC2 #xA0 (encoded by coding system utf-8-unix)
display: by this font (glyph code):
x:-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1 (#xA0)
hardcoded face: nobreak-space
Character code properties: customize what to show
name: NO-BREAK SPACE
old-name: NON-BREAKING SPACE
general-category: Zs (Separator, Space)
decomposition: (noBreak 32) (noBreak ' ')
You should probably add C-u C-x =
to your tool arsenal: it comes in handy very often, particularly when you are scratching your head about something weird happening and you want to dig in a bit deeper.