(char-from-name "ZERO WIDTH SPACE") 'zero-width)
See C-hig (elisp)Glyphless Chars
Personally I want these things to be as visible as possible -- I've encountered a situation where I was unwittingly copying and pasting zero-width spaces and created a mess because I never knew they ...
Section 126.96.36.199 Basic Char Syntax of the Elisp manual says:
The usual read syntax for alphanumeric characters is a question mark
followed by the character; thus, ‘?A’ for the character ‘A’, ‘?B’ for
the character ‘B’, and ‘?a’ for the character ‘a’.
?Q ⇒ 81 ?q ⇒ 113
You can use the same syntax for punctuation characters. ...
This isn't recursive, because there are actually three bits of code in play. First there is the Lisp function char-charset, then there is the CHAR_CHARSET macro, and finally there is the C function char_charset. All three are distinct. The Lisp function char-charset is also given the name Fchar_charset inside the Emacs binary's symbol table, although there ...
You can use the per-command setting of the encoding that @choroba mentions in his comment (C-x RET c utf-8) which will only affect the next command, but you can also set UTF-8 to be the default encoding everywhere. Add
to your init file and restart emacs. Or for the current session, click on "Options/...
You could add the non-breaking space as a new font-lock keyword to python-mode:
;; I'm defining a new face, though any face with underline should work
'((t :inherit default :underline t))
"My non-breaking space face.")
(font-lock-add-keywords 'python-mode '(("\u00a0" . 'my-nobreak-space)))
Contrary to @db48x, I don't think it's due to Emacs sending wrong sequences to your terminal, but rather the other way around: those ^[OB thingies look very much like the byte-sequence normally sent by a terminal emulator when you hit some keys such as "page down".
So, you might want to look at C-h l (aka view-lossage) to see the exact bytes that ...
Sounds like Emacs is sending escape sequences that iTerm2 doesn't understand, so probably your TERM variable has the wrong value, or your terminfo database has incorrect information in it (though that's much less likely).
You would probably be happier overall if you were just running Emacs directly, rather than running it in a terminal emulator. It would ...