From a857187681172534c1d70da5e92e4dcc638bb4f8 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 31 Jan 2021 21:09:30 +0100 Subject: issue #5363: Indexing and searching cannot treat non ASCII identifiers --- templates/html/search.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/html/search.js b/templates/html/search.js index fb226f7..c1e0f28 100644 --- a/templates/html/search.js +++ b/templates/html/search.js @@ -335,11 +335,15 @@ function SearchBox(name, resultsPath, inFrame, label, extension) var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); var code = searchValue.toLowerCase().charCodeAt(0); - var idxChar = searchValue.substr(0, 1).toLowerCase(); + var idxChar = searchValue.substr(0, 1); if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair { idxChar = searchValue.substr(0, 2); } + else if (code <128) + { + idxChar = idxChar.toLower(); + } var resultsPage; var resultsPageWithSearch; -- cgit v0.12