I have found a bug in ToHex function.
mkornaukhov03 opened this issue · 3 comments
mkornaukhov03 commented
Hi! It seems there is a bug: https://github.com/cpeditor/lsp-cpp/blob/master/include/LSPUri.hpp#L100
I suppose the line is going to be return ch > 9 ? ch + 65 : ch + 48;
, because 65 (not 55) - is ASCII code for 'A' letter.
coder3101 commented
Yes this indeed is a bug. However, the library still works because the URI is rarely encoded in hex, unless file path has some very special characters in it.
ouuan commented
This was actually fixed in the upstream: alextsao1999/lsp-cpp@6b973f8.
We could merge the upstream.
ouuan commented
It seems that the upstream changes don't compile by simply copy-pasting. I'll fix this then.