# Unicode usernames and group names

**URL:** https://meta.discourse.org/t/unicode-usernames-and-group-names/117737
**Category:** Announcements
**Tags:** new-feature
**Created:** [5월 14, 2019, 8:18오후 UTC](https://meta.discourse.org/t/unicode-usernames-and-group-names/117737 "2019-05-14T20:18:48Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [5월 14, 2019, 8:18오후 UTC](https://meta.discourse.org/t/unicode-usernames-and-group-names/117737/1 "2019-05-14T20:18:48Z")

</div>

Lifting the restrictions on allowed characters in usernames is one of the oldest feature requests. Starting with Discourse 2.3.0.beta9 it’s finally possible to use Unicode characters within usernames and group names.

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/0/506b1ba992c9b13344cd1416d0fa1197dbe4f4c3.png)

### New Site Settings

There are two new site settings: `allowed unicode username characters` and `unicode usernames`.

**`allowed unicode username characters`** allows you to allow only certain Unicode characters (e.g. `[äöüßÄÖÜẞ]` or `\p{Greek}`). By default Discourse permits letters ([Ll](https://www.compart.com/en/unicode/category/Ll) / [Lm](https://www.compart.com/en/unicode/category/Lm) / [Lo](https://www.compart.com/en/unicode/category/Lo) / [Lt](https://www.compart.com/en/unicode/category/Lt) / [Lu](https://www.compart.com/en/unicode/category/Lu)), marks ([Mc](https://www.compart.com/en/unicode/category/Mc), [Me](https://www.compart.com/en/unicode/category/Me), [Mn](https://www.compart.com/en/unicode/category/Mn)) and numbers ([Nd](https://www.compart.com/en/unicode/category/Nd), [Nl](https://www.compart.com/en/unicode/category/Nl), but _not_ [No](https://www.compart.com/en/unicode/category/No)). The setting can restrict those characters, but it’s not possible to allow additional characters. Also, it’s not possible to forbid ASCII letters and numbers.

You should tailor it to your community’s needs and only allow characters and scripts that are needed for the languages used by your community.

Take a look at the Ruby documentation if you want to know more about [character classes](https://ruby-doc.org/core/Regexp.html#class-Regexp-label-Character+Classes) and [character properties](https://ruby-doc.org/core/Regexp.html#class-Regexp-label-Character+Properties) in regular expressions.

**`unicode usernames`** is disabled by default and we **strongly advise** you to configure the `allowed unicode username characters` setting before enabling it in order to prevent [homograph username spoofing](https://www.google.com/search?q=homograph+attacks).

Example allowed values:

- zh\_CN Chinese: `[\p{Han}]`
- zh\_TW Chinese: `[\p{Han}]`
- ko Korean only: `[\p{Hangul}]`
- jp Japanese: `[\p{Han}\p{Katakana}\p{Hiragana}]`
- jp Japanese (カタカナ only): `[\p{Katakana}]`
- fi Finnish: `[åäöÅÄÖ]`
- cs Czech: `[ěščřžýáíéóůúďťň]`

### Letter Avatar Service

The Letter Avatar Service has been updated and we added support for generating avatars with the most commonly used scripts. Feel free to create a [pull request on GitHub](https://github.com/discourse/letter-avatars) to add a font from the [Google Noto Fonts](https://www.google.com/get/noto/) family if you encounter missing avatars for your language.

Enabling `unicode usernames` is only possible when the `external system avatars enabled` site setting is enabled, because the internal avatar generator doesn’t support Unicode. You can run your own instance of the [Letter Avatar Service](https://github.com/discourse/letter-avatars) if you can’t or don’t want to rely on the external service.

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/f/2feda198ce2dcc1935f32de83226fb78175fcb90.png) We even support the brand new glyph for “令和” ([Reiwa](https://en.wikipedia.org/wiki/Reiwa)) that was added to Unicode in May.

### Good to know…

Discourse counts [_grapheme clusters_ (“user-perceived characters”)](http://www.unicode.org/reports/tr29/) instead of Unicode codepoints when it validates username length (`min username length` and `max username length` site settings). The Letter Avatar Service also uses the first grapheme cluster of a username to generate an avatar.

You should also take a look at the `reserved usernames` site setting. You might want to add additional usernames now that your forum supports Unicode in usernames.

### Feedback

Did you enable Unicode usernames for your community? We’d like to hear your feedback.  
Also, we want to ship sensible default values for the `unicode username character whitelist` for each locale supported by Discourse. Please feel free to suggest regular expressions in a reply.

---

_[View the full topic](https://meta.discourse.org/t/unicode-usernames-and-group-names/117737)._
