Closed LuckyTil closed 11 months ago
Hello, Ihor!
- Which WebMarkupMin ASP.NET extension are you using?
WebMarkupMin.AspNetCore5 2.14.1
- Is this XML code generated programmatically or is it a static file?
XML generated programmatically and returned due ControllerBase.File method, stream overload, content type "text/xml"
XML generated programmatically and returned due ControllerBase.File method, stream overload, content type "text/xml"
This extension determines the text encoding based on the ContentType
property of response. Try replacing the text/xml
content type by the text/xml; charset=windows-1251
.
This extension determines the text encoding based on the ContentType property of response. Try replacing the text/xml content type by the text/xml; charset=windows-1251.
Why did XML header not used to determine encoding?
<?xml version="1.0" encoding="windows-1251"?>
Why did XML header not used to determine encoding?
Because text content is read from the response and at the time of reading, data is available only as an array of bytes. To convert an array of bytes to text, we need to know the encoding.
Thank You, @Taritsyn
.AddXmlMinification( options => { options.MinificationSettings.CollapseTagsWithoutContent = true; } )
When process to download XML with encoding "windows-1251", tags (maybe attributes too) with Cyrillic content become corrupt.
Example
Corrupted value: `
`
Correct value: `
`