Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Unicode support #2

Closed
lain-dono opened this issue Apr 26, 2024 · 1 comment
Closed

Basic Unicode support #2

lain-dono opened this issue Apr 26, 2024 · 1 comment

Comments

@lain-dono
Copy link

Strings in rust contain utf-8 encoded characters. Which is a variable character length encoding. So

let mut index = indicium::simple::SearchIndex::<usize>::default();
index.search("лол"); // lol in Cyrillic

causes an error

thread 'main' panicked at indicium-0.6.1/src/simple/internal/strsim/strsim_context_autocomplete.rs:51:30:
byte index 3 is not a char boundary; it is inside 'о' (bytes 2..4) of `лол`

Here's an example of an internal representation:

lol: [108, 111, 108]
лол: [208, 187, 208, 190, 208, 187]
@leontoeides
Copy link
Owner

Thank you for reporting this @lain-dono. This has been corrected, I've added a test, and a new version has been published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants