-
Notifications
You must be signed in to change notification settings - Fork 162
False Positive: Source file is not valid UTF-8 #57
Comments
I get this too, but only in vsc, never in emacs |
I think I've reproduced it. It happens whenever I type in a character such as 'à' or 'é' by accident. |
What happens if you compile the file using clang after having typed the character? Does it complain? |
Clang compiles without warnings or errors |
depends on which version is being used to compile, it could be clang 5 since this plugin is using 4. |
its definately a bug, it compiles fine, and as mentioned, only happens in the vscode client. |
Fixed? |
Still happens for me when using umlauts in literals for example. |
Example source file? |
I can confirm that this still happens. How to reproduce:
My guess is it might be a bug in vscode client. |
nope, happens in emacs too - but often it works for me to just delete the line i entered a bad char on and paste it back (saving for reindex in between) |
Seems like this is caused by the fact that all the offsets and lengths in Language Server Protocol is given as the amount of Sounds difficult to fix without introducing UTF-16 aware Edit: Nope, it's not UTF-8, it's UTF-16 as per specification. But |
And what's worse, lsp-mode have no idea about these UTF-16 things, so positions coming from Emacs would be in UTF-8 characters. Maybe we could use an UTF-8 iterator of std::string for working on |
…less UTF-16 surrogate pairs are used #57
Thank @Riatre for troubleshooting. Emacs lsp-mode is good now. Don't use emojis 😿 in VSCode |
I sometimes get a 'source file is not valid UTF-8' error when editing C++ code with cquery. Haven't been able to find out how to reproduce it.
Commenting/uncommenting line doesn't remove the error. Removing and pasting all the code in the file does remove the error
The text was updated successfully, but these errors were encountered: