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

Unicode characters are lost during format on save #713

Closed
mstijak opened this issue Aug 10, 2022 · 3 comments
Closed

Unicode characters are lost during format on save #713

mstijak opened this issue Aug 10, 2022 · 3 comments

Comments

@mstijak
Copy link

mstijak commented Aug 10, 2022

I experience the same issue as #545 with the latest version of the CSharpier extension and VS2022.

All Unicode characters are replaced with ASCII versions or question marks during the format. For example, Š becomes S.

This is a good file for reproducing the issue:
https://github.com/apache/lucenenet/blob/master/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/ASCIIFoldingFilter.cs

I tried to provide a failing test, but I cannot build the project on my machine.

@belav
Copy link
Owner

belav commented Aug 10, 2022

I haven't been able to reproduce this so far.
I tried with
VS2022 Professional 64bit 17.3.0 and 17.2.5 (I think? I updated to latest after it worked on the 17.2.x version I had)
CSharpier 0.18.0
CSharpier Plugin 1.3.0
Windows 10

I tried both the right click "Reformat with CSharpier" as well as format on save.

With the interactions between the plugin and csharpier, providing a test is harder. As far as I know csharpier itself has handled unicode properly for quite a while.

Could there be something else running on save? You could disable the format on save of csharpier, and see if you still lose unicode. Files that start with // <autogenerated also get ignored by csharpier

@belav
Copy link
Owner

belav commented Aug 11, 2022

One thing I just thought of but am not able to test right now - this could have to do with the file encoding. When I tested, I copied the contents into a new file. I'll test with the actual file to see I can reproduce it that way.

@mstijak
Copy link
Author

mstijak commented Aug 11, 2022

Everything is ok. This was my fault. I checked only the version of the VS extension, but the problem was with the old version of the tool. Thanks for providing the version info. That helped me realize the problem.

@mstijak mstijak closed this as completed Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants