MODiX icon indicating copy to clipboard operation
MODiX copied to clipboard

Detect users with "invisible" names

Open kameko opened this issue 6 years ago • 0 comments

It's a minor annoyance that sometimes a user will appear with a username that only contains whitespace unicode characters, making them unpingable.

I have verified string.IsNullOrWhiteSpace()/char.IsWhiteSpace() detect whitespaces for all the characters in https://en.wikipedia.org/wiki/Whitespace_character which have the "WSpace=Y" property, but it does not detect the characters without the "WSpace=Y" property. These characters are 0x180E, 0x200B, 0x200C, 0x200D, 0x2060, 0xFEFF, which I assume would need to be put into a list and also matched with the username to check if it only contains those characters. MODiX should ideally check every username on boot and from then just rely on to the user joined and user updated events (I forget if this event applies to usernames and not just nicknames)

As to what to do with the user, you could either make an automatic note, auto-rename them, or maybe send them a DM.

kameko avatar May 25 '19 10:05 kameko