# @mention full name autocomplete doesn't work with international characters

**URL:** https://meta.discourse.org/t/mention-full-name-autocomplete-doesnt-work-with-international-characters/29819
**Category:** Feature
**Created:** [6월 9, 2015, 8:09오후 UTC](https://meta.discourse.org/t/mention-full-name-autocomplete-doesnt-work-with-international-characters/29819 "2015-06-09T20:09:12Z")
**Posts on this page:** 9
**Page:** 2

<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: [6월 11, 2015, 8:18오전 UTC](https://meta.discourse.org/t/mention-full-name-autocomplete-doesnt-work-with-international-characters/29819/22 "2015-06-11T08:18:31Z")

</div>

There is a severe issue with the implementation that must be resolved first if we were even to consider this.

IF you searched for “bob mar” and got zero results, we should not bother searching for “bob marl” cause it can not exist. As it stands our search logic is not smart enough to cover this.

A change in this department would heavily increase the search traffic as “@bob bob bob bob would trigger a search”

Also another terrible edge case would be when you already match `@sam` and then type `@sam s` it would show a search pop up, which is clearly not intended.

Its possible this could work, but full of complex dragons. So my vote for now is simple to cut off on space.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [6월 11, 2015, 8:19오전 UTC](https://meta.discourse.org/t/mention-full-name-autocomplete-doesnt-work-with-international-characters/29819/23 "2015-06-11T08:19:55Z")

</div>

> [@sam](#):
>
> cut off on space

… or linebreak 🔚

---

<div class="post-metadata">

### Author: ![noamraph](https://avatars.discourse-cdn.com/v4/letter/n/a88e57/32.png) [@noamraph](https://meta.discourse.org/u/noamraph)
#### Post date: [6월 11, 2015, 11:29오후 UTC](https://meta.discourse.org/t/mention-full-name-autocomplete-doesnt-work-with-international-characters/29819/24 "2015-06-11T23:29:11Z")

</div>

I tested on my local installation with the patch applied.

After the search list is closed, no further requests are being made. So after you search for “bob mar” and get zero results, “bob marl” isn’t searched.

`@bob bob bob` does trigger a repeated search. But this seems rather rare to me, and can be fixed by returning an empty result list if the query string contains multiple occurrences of the same word (only words followed by a space should be considered).

If you already match `@sam` (by pressing enter), the autocomplete list gets closed, and so doesn’t show up again if you continue to `@sam s`. If you type something like `@sam how are you`, the autocomplete list would be closed as soon as there isn’t a matching user, so it would be quite fast.

To summarize, the current logic is quite simple – close the list as soon as there are no matching users or if a user is selected, and then forget about the search. It solves all of your concerns except for `bob bob bob`, which seems like a pretty rare case for me and can be solved by adding a simple logic to the search function.

Basically, I don’t see dragons here because the chance of a string to match a user drop rapidly as its length increases, so the autocomplete list would be closed pretty quickly anyway.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [6월 12, 2015, 2:08오전 UTC](https://meta.discourse.org/t/mention-full-name-autocomplete-doesnt-work-with-international-characters/29819/25 "2015-06-12T02:08:56Z")

</div>

We will not be matching spaces, sorry. Matching Unicode is a different issue.

---

<div class="post-metadata">

### Author: ![noamraph](https://avatars.discourse-cdn.com/v4/letter/n/a88e57/32.png) [@noamraph](https://meta.discourse.org/u/noamraph)
#### Post date: [6월 12, 2015, 9:28오전 UTC](https://meta.discourse.org/t/mention-full-name-autocomplete-doesnt-work-with-international-characters/29819/26 "2015-06-12T09:28:04Z")

</div>

OK. That’s your call after all!

---

<div class="post-metadata">

### Author: ![danielhers](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danielhers/32/121853_2.png) [@danielhers](https://meta.discourse.org/u/danielhers)
#### Post date: [4월 15, 2016, 6:04오후 UTC](https://meta.discourse.org/t/mention-full-name-autocomplete-doesnt-work-with-international-characters/29819/27 "2016-04-15T18:04:04Z")

</div>

Sorry for reviving this, but having read the whole thread I fail to understand why it was abandoned - it seems to me like there is a consensus that matching on (at least) any non-space character is acceptable. So why is the [regex](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/lib/user-search.js.es6#L94) still matching only ASCII alphanumerics and dots/underscores?

---

<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: [4월 15, 2016, 11:19오후 UTC](https://meta.discourse.org/t/mention-full-name-autocomplete-doesnt-work-with-international-characters/29819/28 "2016-04-15T23:19:10Z")

</div>

Perhaps you can submit a PR with test cases for a proposed change?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [4월 15, 2016, 11:55오후 UTC](https://meta.discourse.org/t/mention-full-name-autocomplete-doesnt-work-with-international-characters/29819/29 "2016-04-15T23:55:40Z")

</div>

Sam, I’ve read the js file in question and it mentions that Site Settings isn’t avaliable at load time.

I really would like to customize this, because when I search for “Rafael” and there are 5.000 “Rafael\*” on my instance it makes the search useless. :sadpanda:

Would we be able to overwrite the it when it gets moved to ES6?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [8월 22, 2018, 4:44오후 UTC](https://meta.discourse.org/t/mention-full-name-autocomplete-doesnt-work-with-international-characters/29819/30 "2018-08-22T16:44:46Z")

</div>

Fixed by [FIX: Allow non-english usernames in autocomplete · discourse/discourse@7c95032 · GitHub](https://github.com/discourse/discourse/commit/7c950321d1b6d0d83359d6ccc4560d3b41e53c45#diff-508d69f2260fdad85feebdd21da2cba7)

[Previous page](https://meta.discourse.org/t/mention-full-name-autocomplete-doesnt-work-with-international-characters/29819.md?page=1)
