Skip to content
Snippets Groups Projects
Commit e9b609bf authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

nix-log2xml: Handle UTF-8 characters

C++ chars can be negative...
parent 9367046f
No related branches found
No related tags found
Loading
...@@ -137,7 +137,7 @@ void Decoder::finishLine() ...@@ -137,7 +137,7 @@ void Decoder::finishLine()
if (line[i] == '<') cout << "&lt;"; if (line[i] == '<') cout << "&lt;";
else if (line[i] == '&') cout << "&amp;"; else if (line[i] == '&') cout << "&amp;";
else if (line[i] == '\r') ; /* ignore carriage return */ else if (line[i] == '\r') ; /* ignore carriage return */
else if (line[i] < 32 && line[i] != 9) cout << "&#xfffd;"; else if (line[i] >= 0 && line[i] < 32 && line[i] != 9) cout << "&#xfffd;";
else if (i + sz + 33 < line.size() && else if (i + sz + 33 < line.size() &&
string(line, i, sz) == storeDir && string(line, i, sz) == storeDir &&
line[i + sz + 32] == '-') line[i + sz + 32] == '-')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment