In contrast to its use in strings, however, a backslash in the name
of a symbol simply quotes the single character that follows the
backslash. For example, in a string, ‘\t’ represents a tab
character; in the name of a symbol, however, ‘\t’ merely quotes the
So the symbol
foobar\? is in fact exactly what you asked for.
If you evaluate
'foobar? you will see the same thing.
Note that, as always, what you're seeing is the printed representation of the returned value.
The slightly curious thing is that, as detailed in that info node (and indeed demonstrated by evaluating
? does not need to be escaped in symbol names. Evidentially Emacs is choosing to print it that way, but I couldn't tell you why that is.
(symbol-name (intern "foobar?"))