I just found out that my program was not working because there was a strange (garbage?) character in a string that was present (got introduced while copy-pasting maybe) in a string supposed to be displayed to the user. Emacs was not showing me this strange character. I was just seeing a whitespace (as was expected).
After wasting three hours on this, I opened the file in Vim and I was able to see a couple of ?
and slashes. How do I make Emacs show these characters like Vim does?
I am attaching the difference in how the two editors render text.
Those are not "strange" characters. They're (presumably) Unicode curly double-quote chars:
You can tell that by putting your cursor just before each one and hitting C-u C-x =
.
The fact that Emacs shows them as the chars they are, i.e., correctly, is normal. (And Emacs did not show them as whitespace.) The fact that your other editor can't display them is a bug, or lack of a feature.
If you type or paste chars that are perfectly renderable then don't expect Emacs to not render them correctly but instead to signal that you inserted some chars you didn't want to.
If you want Emacs to only render ASCII chars then tell it to do so. Then those "strange" chars will be rendered with octal escapes or in some other clearly visible way.
See the Emacs manual, node Coding Systems, and the Elisp manual, node Explicit Coding and Decoding.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With