Index: tools/lldb-vscode/lldb-vscode.cpp =================================================================== --- tools/lldb-vscode/lldb-vscode.cpp +++ tools/lldb-vscode/lldb-vscode.cpp @@ -967,10 +967,14 @@ if (value.GetError().Fail()) { response.try_emplace("success", false); const char *error_cstr = value.GetError().GetCString(); - if (error_cstr && error_cstr[0]) - response.try_emplace("message", std::string(error_cstr)); - else + if (error_cstr && error_cstr[0]) { + std::string error_string(error_cstr); + if (!llvm::json::isUTF8(error_string)) + error_string = llvm::json::fixUTF8(std::move(error_string)); + response.try_emplace("message", error_string); + } else { response.try_emplace("message", "evaluate failed"); + } } else { SetValueForKey(value, body, "result"); auto value_typename = value.GetType().GetDisplayTypeName();