Unicode usernames and group names

I’m happy to see support for Unicode usernames and group names :+1:.

With the introduction of the support for Unicode usernames however, there’s now a bit of a odd situation where Discourse can support something like 中国 or ไทย as a username, but not -dashing- as it still requires the first and last character to be a letter, number or underscore (but not a dash).

I tried using the Unicode support setting to add support for the dash character but that didn’t seem to work for me, although I may have missed something.

Would it make sense to revise this rule for the first/last characters about the dash now that Unicode is supported? Is there a reason to continue not allowing dash on the first&last position but allow any non-ASCII letter (including the underscore)? Dash doesn’t seem to require special encoding on URLs, but maybe there’s another reason for this?

I know this is a bit of a tangent to the topic, so let me know if I should open a separate one.