-
Notifications
You must be signed in to change notification settings - Fork 5k
U+0085 not recognised as a newline character in CSharpCodeGenerator.cs (#1740) #1853
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
U+0085 not recognised as a newline character in CSharpCodeGenerator.cs Fix $1740
U+0085 not recognised as a newline character in CSharpCodeGenerator.cs
U+0085 not recognised as a newline character in CSharpCodeGenerator.cs This change fixes a previous test that incorrectly causes the character to be forced out of being in unicode format.
src/libraries/System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs
Show resolved
Hide resolved
src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/CSharpCodeGenerationTests.cs
Show resolved
Hide resolved
It seems like the test is failing on 2 platforms: Windows_NT netfx x86 Release, and Windows_NT x64. |
This change will be disabled for .NET Framework, and Microsoft can add it if they wish, see #1913 |
include new changes
Include new changes
As all of the checks have now passed, this is now ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
Thanks @hamarb123! |
U+0085 is not recognised as a newline character in CSharpCodeGenerator.cs, this fixes that.
This an issue is because it is recognised as a newline character in C# (see here), which cannot be in literal strings.
Specifically:
and
If the CSharpCodeGenerator class was used to make code with a string in it that has U+0085 in it, it would generate invalid C# code.
I have also added a test which ensures that all of the newline characters (other than \n and \r) are generated properly.
Fix for #1740