From 4d37803f5c8fee993c9a76c2ca01f4fbb829ccca Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Mon, 7 Oct 2013 18:36:45 +0200 Subject: [PATCH] Remove non-UTF-8 from completion command output Previously an entire line containing non-UTF-8 would be discarded, now we only remove the problematic bytes. --- Frameworks/editor/src/completion.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Frameworks/editor/src/completion.cc b/Frameworks/editor/src/completion.cc index db8e1ef1..2f8efa98 100644 --- a/Frameworks/editor/src/completion.cc +++ b/Frameworks/editor/src/completion.cc @@ -105,7 +105,8 @@ namespace ng { for(auto line : text::tokenize(delegate->result.begin(), delegate->result.end(), '\n')) { - if(!line.empty() && utf8::is_valid(line.begin(), line.end())) + line.erase(utf8::remove_malformed(line.begin(), line.end()), line.end()); + if(!line.empty()) commandResult.push_back(line); } }