mirror of https://github.com/kiwix/libkiwix.git
+ fix small regression in indexinv (title were without accents)
This commit is contained in:
parent
c20fd205dd
commit
6ae3c27195
|
@ -47,7 +47,8 @@ namespace kiwix {
|
|||
this->resultCountPerPage = resultEnd - resultStart;
|
||||
this->resultStart = resultStart;
|
||||
this->resultEnd = resultEnd;
|
||||
searchInIndex(removeAccents(search), resultStart, resultEnd, verbose);
|
||||
string unaccentedSearch = removeAccents(search);
|
||||
searchInIndex(unaccentedSearch, resultStart, resultEnd, verbose);
|
||||
this->resultOffset = this->results.begin();
|
||||
|
||||
return;
|
||||
|
|
|
@ -22,13 +22,13 @@
|
|||
UErrorCode status = U_ZERO_ERROR;
|
||||
Transliterator *trans = Transliterator::createInstance("Lower; NFD; [:M:] remove; NFC", UTRANS_FORWARD, status);
|
||||
|
||||
std::string &removeAccents(std::string &text) {
|
||||
std::string removeAccents(const std::string &text) {
|
||||
ucnv_setDefaultName("UTF-8");
|
||||
UnicodeString ustring = UnicodeString(text.c_str());
|
||||
trans->transliterate(ustring);
|
||||
text.clear();
|
||||
ustring.toUTF8String(text);
|
||||
return text;
|
||||
std::string unaccentedText;
|
||||
ustring.toUTF8String(unaccentedText);
|
||||
return unaccentedText;
|
||||
}
|
||||
|
||||
void printStringInHexadecimal(UnicodeString s) {
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
std::string &removeAccents(std::string &text);
|
||||
std::string removeAccents(const std::string &text);
|
||||
void printStringInHexadecimal(const char *s);
|
||||
void printStringInHexadecimal(UnicodeString s);
|
||||
|
||||
|
|
Loading…
Reference in New Issue