From bd5205688ae386b004e4f696687371073160705a Mon Sep 17 00:00:00 2001 From: kelson42 Date: Thu, 24 Mar 2011 07:24:23 +0000 Subject: [PATCH] + better fix the the multibyte character issue. --- src/common/kiwix/indexer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/kiwix/indexer.cpp b/src/common/kiwix/indexer.cpp index e74591e04..beb038796 100644 --- a/src/common/kiwix/indexer.cpp +++ b/src/common/kiwix/indexer.cpp @@ -134,6 +134,8 @@ namespace kiwix { /* snippet */ std::string snippet = std::string(this->htmlParser.dump, 0, 300); std::string::size_type last = snippet.find_last_of('.'); + if (last != snippet.npos) + last = snippet.find_last_of(' '); if (last != snippet.npos) snippet = snippet.substr(0, last+1);