Closed mark-storefeeder closed 5 months ago
@mark-storefeeder thanks for contacting us.
Does this happen in an SSR form or when the app is running interactively. Also, does this happen in any previous version?
@javiercn I don't know how to test the SSR / interactive scenario, but I'm happy to take a look if you can explain how.
All I know is that it happens in an off-the-shelf Blazor WASM application.
It seems to happen in at least .NET 6, 7 and 8.
I've seen it in a few production applications, including our own, Telerik's REPL (example) and MudBlazor (example).
Thanks for contacting us. What you're observing here is a browser behavior which converts characters which aren't valid for hostnames to a Punycode character set. You can learn more about this in https://en.wikipedia.org/wiki/Punycode.
Is there an existing issue for this?
Describe the bug
In a Blazor project, given the following Razor code:
In Google Chrome, when you enter certain strings which include extended ASCII characters AFTER the @ sign in the email address, the bound value isn't what you'd expect
For example, when you enter a@£, when the field loses focus the bound value is shown as a@xn--9a.
This seems to be Chrome only - the same thing does NOT happen in Firefox.
Windows 11 Enterprise 23H2, Google Chrome 124.0.6367.91.
Expected Behavior
The bound value should be the same as the value that's been typed - so if the user types
a@£
then the bound value should bea@£
.Steps To Reproduce
Add the following markup and code to the home page:
a@£
in the input field and tab or click out of the field so it loses focus.a@xn--9a
when it should be displayed asa@£
.Exceptions (if any)
No response
.NET Version
8.0.204
Anything else?
dotnet --info
output: