mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
+ fix a bug occuring if cutting the snippet in the middle of a multibyte character
This commit is contained in:
@ -132,7 +132,10 @@ namespace kiwix {
|
||||
const std::string wordCountString = countWordStringStream.str();
|
||||
|
||||
/* snippet */
|
||||
const std::string snippet = std::string(this->htmlParser.dump, 0, 300);
|
||||
std::string snippet = std::string(this->htmlParser.dump, 0, 300);
|
||||
std::string::size_type last = snippet.find_last_of('.');
|
||||
if (last != snippet.npos)
|
||||
snippet = snippet.substr(0, last+1);
|
||||
|
||||
/* size */
|
||||
stringstream sizeStringStream;
|
||||
|
@ -178,7 +178,7 @@ namespace kiwix {
|
||||
}
|
||||
oData["pages"] = pagesCDT;
|
||||
|
||||
oData["count"] = this->estimatedResultCount;
|
||||
oData["count"] = this->beautifyInteger(this->estimatedResultCount);
|
||||
oData["searchPattern"] = this->searchPattern;
|
||||
oData["resultStart"] = this->resultStart;
|
||||
oData["resultEnd"] = this->resultEnd;
|
||||
|
Reference in New Issue
Block a user