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
UTF encoding of auto generated code behind C# file changes when feature file text changes #1871
Comments
Interesting. I checked some code-behind files in 2 projects and they are all UTF-8. |
We have a script in our Cruise Control build verifying that the correct encoding (UTF-8-BOM) is being used (this is the default encoding of .cs files for C# when you add a new class in Visual Studio). After a feature file has changed, we are getting warnings when this nightly script is ran due to this issue, when we don't remember to change the encoding before committing to git. |
I made some research and found out that UTF-8 + BOM is really the default encoding for C#- files. That was a surprise for me, I always thought it was only UTF-8. So I am happy to review and accept a PR that fixes this. Should not be a big change. I think only the |
Thanks for researching the issue and accepting the change. This will remove one of these have to remember items for us in a future release of SpecFlow. |
Fixes #1871 Co-authored-by: Andreas Willich <SabotageAndi@users.noreply.github.com>
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I came across an encoding issue when I upgraded from a direct DLL reference to Specflow version 2.2.0 - to a NuGet reference of version 3.1.7.4.
Now when I change text in my feature file, Specflow changes the encoding of its associated code behind C# file from UTF-8-BOM to UTF-8.
The manual fix is easy, you just open the .cs C# file in Notepad++, click the encoding menu and change it back from "Encode in UTF-8" to "Encode in UTF-8-BOM" and save the file.
This is obviously easily forgotten and annoying to remember!
The text was updated successfully, but these errors were encountered: