-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Encoding During Format On Save #545
Comments
Is there a public repo that I could use to recreate the issue? The unicode character formats as expected when using csharpier.com and I won't have access to a computer to test it properly until next week. In theory csharpier is supposed to leave files in the same encoding that it finds them. Also if you end up trying it yourself on csharpier.... It seems like the cert has just expired. |
I'll try create a public repo over the weekend. On csharpier it works correctly. |
I've uploaded a sample Here I'm assuming this is where the trouble happens: Probably need to set the encoding correctly. I'm not sure what "correctly" means though :D. |
I think I should be able to reproduce it now and get a fix out pretty quickly next week. My guess is that properly means determining the encoding of the file earlier, and then reading the output using that encoding. |
The fix for this is mostly ready to go, I just need to do some more testing. It will require a new version of csharpier. And a new version of the VS and rider extensions. |
* Adding documentation for husky.net + implement it. Clean up the solution a bit with notarget projects. * self code review * More self code review * rename file * Make sure the pre-commit hook is opt in * Update task-runner.json * Narrowing down where the unicode encoding issue is for #545 * Adding some notes and logging. * Getting UTF8 working on vs and vscode * Cleanup plus getting rider working with utf8 * some cleanup * Self code review * Update CliTests.cs
This is resolved with csharpier 0.14.0 + 1.0.1 of the VS extension or 1.0.4 or the rider extension. The rider extension requires jetbrains to manually approve each update so it may not be out for a couple of days. |
Thank you so much. |
You are welcome! |
Firstly, thank you so much for this project.
I am part of an international team and when formatting utf8 files with unicode chars the chars get replaced with "?".
In our .editorconfig we have charset=utf-8
Then in our cs file we have this line:
After saving the file it becomes:
For now I can use '\u' but sometimes we have Japanese text in files so we do not want those to break.
Sorry I left out a lot of needed info...
Using VS2022, global install + extension.
Using command "dotnet csharpier ." doesn't cause this issue.
"Reformat with CSHarpier on Save" = true causes the issue on save.
Thanks.
The text was updated successfully, but these errors were encountered: