Join 36 million developers who use GitHub
issues to help identify, assign, and keep track of the features and
bug fixes your projects need.
An unhandled exception has occurred: Argument encoder does not implement MaxOutputCharsPerInputChar correctly.
System.ArgumentException: Argument encoder does not implement MaxOutputCharsPerInputChar correctly.
在 System.Text.Encodings.Web.TextEncoder.EncodeCore(TextWriter output, Char* value, Int32 valueLength)
在 System.Text.Encodings.Web.TextEncoder.Encode(TextWriter output, String value, Int32 startIndex, Int32 charac
在 Microsoft.AspNet.Mvc.Razor.RazorPage.WriteTo(TextWriter writer, HtmlEncoder encoder, Object value, Boolean e
在 Microsoft.AspNet.Mvc.Razor.RazorPage.WriteTo(TextWriter writer, Object value)
在 Microsoft.AspNet.Mvc.Razor.RazorPage.Write(Object value)
在 Asp.ASPV__Views_Status_Show_cshtml.<ExecuteAsync>d__33.MoveNext() 位置 /Views/Status/Show.cshtml:行号 76
@kagamine using which version of MVC + DNX?
@Tratcher maybe related to your change?
The rc2 latest. If your string contains an unknown encoding character, it will throw this.
I think use a ? to replace the unknown character is better.
I think throw an exception is dangerous. When you developed a blog, someone submit a comment with the unknown encoding char to some post, your site will crash down. @Eilon @davidfowl
If an exception thrown because of user input in a text box can crash your site then you have bigger problems
@Tratcher can you do a quick initial investigation?
Should I write a repro? @Eilon
That would help. Preferably something that calls html encoder directly.
At the very least it would be good to know what the text was that failed.
This looks like a bug in corefx, I've filed an issue: dotnet/corefx#4455. Notice the repro is really simple.
Why file a CoreFx issue about a bug seen when using Mono? Or is this actually a problem when using .NET core?
This occurred with System.Text.Encodings.Web