-
Notifications
You must be signed in to change notification settings - Fork 842
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
Support non-ASCII characters in EuiSearchBar & Query #1415
Support non-ASCII characters in EuiSearchBar & Query #1415
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not address the use case from the original report. I linked in your changes and tried it out and got the same error. 汽车 is my test.
@bmcconaghy did you Your example query works fine in the EUI docs' Search Bar page with these changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unicode changes look sane to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now that I have these changes actually running in my Kibana :-)
Yeah, that is the goal :) |
Summary
Fixes #1409 by adding support for non-western/latin/ASCII characters & punctuation within term & field values. This casts a wide net, allowing any and all UTF-16 characters in the range
U+00C0
-U+FFFF
(begins in Latin-1 Supplement). It's highly unlikely we would want to use any character in that range for another purpose in queries.Implementation
I added the
U+00C0
-U+FFFF
range as a supported value within the grammar'swordChar
entry. PEG.js doesn't understand regex character classes so this abuses the fact that character ranges only care about byte code values. The exact characters forU+00C0
andU+FFFF
are injected into the grammar's source instead of their unicode escape sequences.Checklist
- [ ] This was checked in mobile- [ ] This was checked in IE11- [ ] This was checked in dark mode- [ ] Any props added have proper autodocs- [ ] Documentation examples were added- [ ] This was checked against keyboard-only and screenreader scenarios- [ ] This required updates to Framer X components