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.
This commit is contained in:
Allan Odgaard
2013-10-07 18:36:45 +02:00
parent 2fa5d7ddb2
commit 4d37803f5c

View File

@@ -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);
}
}