ZWSP appearing only in IntelliJ

Answered

I have two test files from an open source project. The tests run ok from the command line and in IntelliJ. When the test file is opened in the IDE,  what appears to be a zero width space character [ZWSP] is appearing at the end of each method name. This is happening on all of the tests in both files. These test classes do not appear to use auto generation tools. I can not reproduce this problem in other IDE. Any ideas would be appreciated. 

1
5 comments

Can you check it in the hex viewer? If there is ZWSP in the code, what's the problem with the IDE then?

0
Avatar
Eric Balawejder

It appears it is the UTF-8 Hex: 0xE2 0x80 0x8B (e2808b)?

0

Yes, so it's indeed in your code.

U+200B 0xe2 0x80 0x8b ZERO WIDTH SPACE
1
Avatar
Eric Balawejder

Indeed. Thank you.

0

(Q) Is there an easy way to remove them all, inside IntelliJ?

Yes.  I selected one then opened the Edit | Find | Replace ... dialog and pasted the character.  It's important to note that the character does not display :-).

Then clicked on Replace All, and all of these were deleted/replaced with an empty string.

0

Please sign in to leave a comment.