# Username completition broken for names with accents like Régis

**URL:** https://meta.discourse.org/t/username-completition-broken-for-names-with-accents-like-regis/65934
**Category:** Bug
**Created:** [7월 10, 2017, 12:30오후 UTC](https://meta.discourse.org/t/username-completition-broken-for-names-with-accents-like-regis/65934 "2017-07-10T12:30:57Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)
#### Post date: [7월 10, 2017, 12:30오후 UTC](https://meta.discourse.org/t/username-completition-broken-for-names-with-accents-like-regis/65934/1 "2017-07-10T12:30:57Z")

</div>

Hello,

In my forum, people have real names with all different kind of accents. I tried to use the username completition launched by typing `@` to mention a user while writing a response and found that I could not find users by their name if the name contains an `é`.

You can test it on your own. Try to find @zogstrip by typing `@` followed by `Ré` for Régis. The actual username lookup is `https://meta.discourse.org/u/search/users?term=r&topic_id=65888&include_groups=true`. Note that all characters from the _e with accent_ on are stripped off from the search query.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [7월 10, 2017, 5:12오후 UTC](https://meta.discourse.org/t/username-completition-broken-for-names-with-accents-like-regis/65934/2 "2017-07-10T17:12:51Z")

</div>

I assume it is a similar issue for Chinese @fantasticfears ? Do you want to take sorting this out?

---

<div class="post-metadata">

### Author: ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)
#### Post date: [7월 11, 2017, 2:16오후 UTC](https://meta.discourse.org/t/username-completition-broken-for-names-with-accents-like-regis/65934/3 "2017-07-11T14:16:13Z")

</div>

Sure, I’ll take a look into this.

---

<div class="post-metadata">

### Author: ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)
#### Post date: [7월 21, 2017, 8:25오전 UTC](https://meta.discourse.org/t/username-completition-broken-for-names-with-accents-like-regis/65934/4 "2017-07-21T08:25:09Z")

</div>

In Europe, we have quite a few countries with numerous non-ASCII first and lastnames: Máté,  
Zétény, Márton, Clémence, Léonie, Aïcha, etc.

So if for instance our German and English speaking forum users try to find or tag those people without having these accents on their keyboard, one might believe the database is incomplete. They just don’t appear if you type the first few letters.

tl;dr: Having this working is really important for regions with more heterogeneous character sets.

Rails should have some helpers therefore:

> <https://stackoverflow.com/questions/15686752/ruby-method-to-remove-accents-from-utf-8-international-characters/15696883#15696883>

```ruby
1.9.3p392 :001 > require "i18n"
 => true
1.9.3p392 :002 > I18n.transliterate("Hé les mecs!")
 => "He les mecs!"

```

---

<div class="post-metadata">

### Author: ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)
#### Post date: [8월 15, 2017, 1:54오후 UTC](https://meta.discourse.org/t/username-completition-broken-for-names-with-accents-like-regis/65934/5 "2017-08-15T13:54:16Z")

</div>

> [@fantasticfears](#):
>
> Sure, I’ll take a look into this.

Any news? :slightly_smiling_face:

---

<div class="post-metadata">

### Author: ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)
#### Post date: [8월 15, 2017, 4:38오후 UTC](https://meta.discourse.org/t/username-completition-broken-for-names-with-accents-like-regis/65934/6 "2017-08-15T16:38:04Z")

</div>

Should be close. Once some code is swept, it will come to alive :slight_smile:

---

<div class="post-metadata">

### Author: ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)
#### Post date: [8월 23, 2017, 2:45오후 UTC](https://meta.discourse.org/t/username-completition-broken-for-names-with-accents-like-regis/65934/7 "2017-08-23T14:45:17Z")

</div>

Related commit:

[https://github.com/discourse/discourse/pull/4974](https://github.com/discourse/discourse/pull/4974)

---

<div class="post-metadata">

### Author: ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)
#### Post date: [5월 21, 2018, 8:48오전 UTC](https://meta.discourse.org/t/username-completition-broken-for-names-with-accents-like-regis/65934/8 "2018-05-21T08:48:46Z")

</div>

I found a related topic:

> [@Fulltext should ignore accents](https://meta.discourse.org/t/fulltext-should-ignore-accents/37178):
>
> Hi there, it is pretty common for search engines (e.g. google) to ignore accents on characters when doing fulltext search. Example: word kôprová omáčka should be matched by query koprova omacka and vice versa. With PostgreSQL unaccent extension this should be pretty easy. [PostgreSQL: Documentation: 9.0: unaccent](http://www.postgresql.org/docs/9.0/static/unaccent.html) Any plans to add this?

The bug can still be reproduced. Régis cannot be tagged if you know not his lastname or his username @zogstrip. :frowning:

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [8월 22, 2018, 3:19오후 UTC](https://meta.discourse.org/t/username-completition-broken-for-names-with-accents-like-regis/65934/9 "2018-08-22T15:19:33Z")

</div>

This works now. @eviltrout [fixed it](https://github.com/discourse/discourse/commit/7c950321d1b6d0d83359d6ccc4560d3b41e53c45) recently :+1:

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/c/7c0b0006d4c3ba97ec74bb7367e2d87a27c5578e.png)

And the request is

```
https://meta.discourse.org/u/search/users?term=r%C3%A9gis&topic_id=65934&include_mentionable_groups=true

```

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [8월 22, 2018, 3:19오후 UTC](https://meta.discourse.org/t/username-completition-broken-for-names-with-accents-like-regis/65934/10 "2018-08-22T15:19:35Z")

</div>


