# User\_name\_suggester se volverá errático en versiones de Discourse no en inglés

**URL:** https://meta.discourse.org/t/user-name-suggester-will-become-buggy-when-in-non-english-version-discourse/107161
**Category:** Bug
**Created:** [22 Enero, 2019 09:23 UTC](https://meta.discourse.org/t/user-name-suggester-will-become-buggy-when-in-non-english-version-discourse/107161 "2019-01-22T09:23:35Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![lisbethw1130](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lisbethw1130/32/129613_2.png) [@lisbethw1130](https://meta.discourse.org/u/lisbethw1130)
#### Post date: [22 Enero, 2019 09:23 UTC](https://meta.discourse.org/t/user-name-suggester-will-become-buggy-when-in-non-english-version-discourse/107161/1 "2019-01-22T09:23:35Z")

</div>

Hi, this is Lisbeth from Taiwan.  
We use Traditional Chinese version discourse here, and we found this bug when our anonymous username become random hex which looks creepy for friendly users LOL.

Our first 100 anonymous username are something like 1111, 1112…111100, after 111100, it will become random hex.

So I keep digging the source code, and see that anonymous user name use a user\_name\_suggester.suggest, it will put Anonymous in Chinese (匿名) these two words into the suggester, when it go through sanitize\_username, everything will be blank

Example:  
sanitize\_username(‘匿名’) ===\> “”

then when “” go through rightsize\_username, it will fill least username with 1, and become 111

I believe most non-english version discourse is suffering in this situation, when we use SSO login, if the username is non-english, this will happen, too.

Probably solution: if the username come from SSO isn’t English or create anonymous user, when go through user\_name\_suggester.sanitize\_username, consider using pinyin ([Pinyin - Wikipedia](https://en.wikipedia.org/wiki/Pinyin)) or something instead of 111 or random hex which is really creepy LOL

Any idea is welcome 🙂

---

<div class="post-metadata">

### Author: ![lisbethw1130](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lisbethw1130/32/129613_2.png) [@lisbethw1130](https://meta.discourse.org/u/lisbethw1130)
#### Post date: [22 Febrero, 2019 10:19 UTC](https://meta.discourse.org/t/user-name-suggester-will-become-buggy-when-in-non-english-version-discourse/107161/2 "2019-02-22T10:19:18Z")

</div>

hmmmm I am wondering no one knows about this?

---

<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: [22 Febrero, 2019 10:54 UTC](https://meta.discourse.org/t/user-name-suggester-will-become-buggy-when-in-non-english-version-discourse/107161/3 "2019-02-22T10:54:32Z")

</div>

It looks like we will be adding support for Unicode usernames in version 2.3 which should solve this problem. There’s already an open pull request for it.

> <https://github.com/discourse/discourse/pull/6822>

---

<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: [1 Octubre, 2019 18:42 UTC](https://meta.discourse.org/t/user-name-suggester-will-become-buggy-when-in-non-english-version-discourse/107161/4 "2019-10-01T18:42:22Z")

</div>

Esto se solucionó en mayo al introducir [Unicode usernames and group names](https://meta.discourse.org/t/unicode-usernames-and-group-names/117737).

---

<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: [1 Octubre, 2019 18:42 UTC](https://meta.discourse.org/t/user-name-suggester-will-become-buggy-when-in-non-english-version-discourse/107161/5 "2019-10-01T18:42:26Z")

</div>


