Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
991 views
in Technique[技术] by (71.8m points)

intellij idea - How to display hidden characters by default (ZERO WIDTH SPACE ie. &#8203)

I just lost part of my weekend because of this ... joker - zero width space. I just used some snippets from google groups and didn't recognize that there are doubled characters, because Idea (11) didn't show them, which was causing problems with parsing config file of my app... I discovered it accidentally in vi.

Is there any way to display such things in IntelliJ (or some other way to examine files) without using external editors.

IntelliJ 11 / Mac OS 10.7

edit - sample

These two lines looks identical, in browser and also in Idea. You can see in page's code that in first - commented line there is hidden zero width space between mysql:// and localhost, which causes problems. Of course if you expect that 'joker', you can try to use search and replace it, however nobody expects the sign that should not be there, especially if he cannot see it in any way.

#db.default.url="jdbc:mysql://?localhost/play-fullcalendar"
 db.default.url="jdbc:mysql://localhost/play-fullcalendar"
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Not sure what you meant, but you can permanently turn showing whitespaces on and off in Settings -> Editor -> General -> Appearance -> Show whitespaces.

Also, you can set it for a current file only in View -> Active Editor -> Show WhiteSpaces.

Edit:

Had some free time since it looks like a popular issue, I had written a plugin to inspect the code for such abnormalities. It is called Zero Width Characters locator and you're welcome to give it a try.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...