Sublime 3 - show bad hidden characters

23,509

Solution 1

Gremlins plugin for Sublime Text 3 does exactly that (it helps to “identify invisible and ambiguous Unicode whitespace characters”). Zero-width characters are marked with an icon in the gutter.

Solution 2

This appears to meet your needs (if not every one of your desires).

Unicode character highlighter for Sublime Text 2 & 3 This plug-in highlights characters such as non breakable space, characters that often break compilers and scripts and is almost impossible to spot in the editor.

Share:
23,509
Mordor
Author by

Mordor

The Lieutenant of Melkor

Updated on July 09, 2022

Comments

  • Mordor
    Mordor almost 2 years

    So I recently switched from Sublime 2 to 3 and I can't get it to show some 'bad' characters (like the encoding/pasting) bugs. Why I need it:

    Sometimes somebody sends me a piece of code (snippet or google analytics code or whatever) via email. I know you are not supposed to send it via email because the mail may add some not wanted characters into code but people still do it. So person sends me some URL via email which ends like this: /⁠org - you notice that 'bug' between '/' and 'org'? I am sure some of you know how its called.

    But when I take this "/⁠org" and paste it into the .php file or .html file or whatever, then Sublime Text 3 will no longer display it! It will just show "/org" like that bug is not even there - but it is there and that url/code/whatever is of course wrong and its invisible/impossible to find it!

    So how can i force Sublime 3 to show these bugs? That's all I need really, just to know when I paste accidentally some bad/corrupted piece of code/string into my script, that there actually IS something bad/corrupted. How can I make Sublime to display everything the same way pastebin does?

  • Saif
    Saif over 4 years
    its not working in mac as of today (Jan 2020). any alternative?
  • jwpfox
    jwpfox over 4 years
    What does “not working” mean specifically? What exactly is the problem you are having, errors being reported, etc.?
  • Nate Beaty
    Nate Beaty about 4 years
    For me it just didn't show anything highlighted in some text where I knew there were some junk hidden characters, whereas Gremlins (mentioned below) found them fine. Not sure if it's a theme issue or what, but hard to diagnose when there's no screenshots, documentation, or anything hinting at how to use it or what it's supposed to show when working.
  • subdesign
    subdesign about 4 years
    my strange case, some plugin puts extra unvisible chars in my code, especially after => operator. Unicode character highlighter plugin show these chars, but couldn't figure out what is causing this behaviour, which is kind of annoying. I have to go back always to delete these chars..