I'm surprised nobody has mentioned PRECIS - the framework for Preparation, Enforcement, and Comparison of Internationalized Strings in Application Protocols[0].
It defines a (small) set of profiles to validate and compare various types of string, including "Username" (in both case folded and case prepared variants) and "Nickname".
Want to compare two usernames for equality? Run the two strings through the comparison steps for the UsernameCaseMapped[1] profile.
It won't solve all of your problems, but it's a good place to start.
It defines a (small) set of profiles to validate and compare various types of string, including "Username" (in both case folded and case prepared variants) and "Nickname".
Want to compare two usernames for equality? Run the two strings through the comparison steps for the UsernameCaseMapped[1] profile.
It won't solve all of your problems, but it's a good place to start.
[0] https://tools.ietf.org/html/rfc8264
[1] https://tools.ietf.org/html/rfc8265#section-3.3