Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C/C++ extension does not work with Unicode identifiers #2034

Closed
BErasmus opened this issue May 23, 2018 · 4 comments
Closed

C/C++ extension does not work with Unicode identifiers #2034

BErasmus opened this issue May 23, 2018 · 4 comments
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service world ready An issue relating string character encodings, localization translations, etc.
Milestone

Comments

@BErasmus
Copy link

BErasmus commented May 23, 2018

I use Unicode identifiers everywhere in my C++ code. It is well supported in Visual Studio. There are some bugs with syntax highlighting for example, but nothing major.

Unfortunately with Visual Studio Code it basically does not work at all. It looks like the problem is caused by the all too common mistake of some code counting in characters interfacing with other code that counts in bytes. Some examples below.

When you bring up the function arguments of a function with a Unicode argument you get a strange "error-type" message.
u1
Note also when the cursor is on a1, the other a1 is also highlighted. But when the cursor is on a2, the Ç character is highlighted.
And note how the color of ABC in struct ABC {}; is different from the color of ḀʙÇ in struct ḀʙÇ {};

Tested on Windows 10, VS Code 1.23.0, C/C++ extension 0.17.3.

@bobbrow bobbrow added bug Language Service world ready An issue relating string character encodings, localization translations, etc. labels May 23, 2018
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Dec 14, 2018
@sean-mcmanus sean-mcmanus added this to the December 2018 milestone Dec 14, 2018
@sean-mcmanus
Copy link
Collaborator

UTF-8 characters > 1 byte should work in identifiers now with our latest Insiders release: https://github.com/Microsoft/vscode-cpptools/releases . If you're using VS Code Insiders or have http.proxySupport not set to "off", you might not get the 0.21.0-insiders2 update automatically with C_Cpp.updateChannel set to "Insiders".

@BErasmus
Copy link
Author

Glad to see that UTF-8 is now much better supported. I noticed that some syntax highlighting problems remain, eg identifiers shown in the wrong color:
untitled3

@bobbrow
Copy link
Member

bobbrow commented Jan 25, 2019

Those colorization bugs would be due to the Atom grammar that is currently used by VS Code to color the file. #230 is on our backlog and should cover this case.

@sean-mcmanus
Copy link
Collaborator

Or after VS Code supports tree-sitter: microsoft/vscode#50140 .

@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service world ready An issue relating string character encodings, localization translations, etc.
Projects
None yet
Development

No branches or pull requests

3 participants