devbridge / jQuery-Autocomplete

Ajax Autocomplete for jQuery allows you to easily create autocomplete/autosuggest boxes for text input fields
https://www.devbridge.com/sourcery/components/jquery-autocomplete/
Other
3.57k stars 1.67k forks source link

Searching in Cyrillic #839

Closed Behruz17 closed 2 years ago

Behruz17 commented 2 years ago

Hello,

I am using this awesome plugin for autocomplete. But in doesn't work with Cyrillic. Although I'm using UTF-8 encoding. Can u help me with this?

Thanks in advance, Behruz

tkirda commented 2 years ago

It does not have anything specific in terms of what encoding should be used. It should work with Cyrillic. Can you be more specific what is it that does not work?

Behruz17 commented 2 years ago

It doesn't show any suggestions and hints when I type Cyrillic letters. auto1 auto2 auto3

Behruz17 commented 2 years ago

@tkirda Can u help me please? It doesn't show any suggestions and hints when I type Cyrillic letters. But when first letter is English and the rest id Cyrillic it works

tkirda commented 2 years ago

If you are playing with samples, try debug / update code where it filters suggestions:

https://github.com/devbridge/jQuery-Autocomplete/blob/master/scripts/demo.js#L17

rivalhw commented 2 years ago

try change the code demo.js line 51 as following :

return suggestion.value.toLowerCase().indexOf(queryLowerCase) === 0;

to as following:

return suggestion.value.toLowerCase().indexOf(queryLowerCase) === 0;

now can support as Chinese、Cyrillic etc.

image

Behruz17 commented 2 years ago

@rivalhw this function is in 18 line. But it doesn't work image

Behruz17 commented 2 years ago

@rivalhw Can you please send me your version (file) ?