Fix RZ1000 error for UTF-8 string literals in Razor files#12783
Open
Fix RZ1000 error for UTF-8 string literals in Razor files#12783
Conversation
Co-authored-by: davidwengier <754264+davidwengier@users.noreply.github.com>
Co-authored-by: davidwengier <754264+davidwengier@users.noreply.github.com>
…idation Co-authored-by: davidwengier <754264+davidwengier@users.noreply.github.com>
Co-authored-by: davidwengier <754264+davidwengier@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix RZ1000 triggered by Utf8 string literals in Razor pages
Fix RZ1000 error for UTF-8 string literals in Razor files
Feb 14, 2026
Member
davidwengier
left a comment
There was a problem hiding this comment.
@copilot it looks like the parser change will work for UTF-8 raw string literals, but there is no test coverage for them. Please add
...osoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs
Outdated
Show resolved
Hide resolved
...uage/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Utf8StringLiterals.cshtml
Outdated
Show resolved
Hide resolved
...uage/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Utf8StringLiterals.cshtml
Outdated
Show resolved
Hide resolved
…ml test file Co-authored-by: davidwengier <754264+davidwengier@users.noreply.github.com>
Contributor
Author
Added test coverage for UTF-8 raw string literals in commit d83c460. This includes:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Member
|
@chsienki would appreciate your signoff on this too, in case there is a better spot you know of for a fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the changes
The Razor parser incorrectly flagged UTF-8 string literals (
"text"u8) as unterminated, triggering RZ1000 errors.Changes:
IsStringProperlyTerminatedhelper toRoslynCSharpTokenizerthat validates strings ending withu8/U8suffix""u8), verbatim strings (@"path"u8), and raw strings ("""text"""u8)@{ },@( ),@code, and@functionsblocks with UTF-8 string literals including raw stringsOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.