How can I view control characters in PhpStorm?

Answered

Every now and then I copy some text from an email into a php file and the text contains one or more control characters.

The resulting behaviour in PhpStorm is strange cursor and backspace movements.

If I paste the text into vi, I can see (and delete) the control character that is causing the problem. An example would be <feff>

Is there any way to view these in PhpStorm? I have tried turning on the show whitespace option, but that does not show these characters. I do not want them left in by accident, I only happened to come across the problem because I had to edit a line that had a control character in it - If I had not needed to edit that line, the character would have been left in my production code, causing who knows what problems!

-1
3 comments

Hi there,

Please try "Zero Width Characters locator" plugin -- it has separate inspection and can detect invisible characters -- maybe it will cover your case.

3
Avatar
Permanently deleted user

This worked perfectly, thanks!

0
Avatar
Permanently deleted user

perfect

0

Please sign in to leave a comment.