X.Web.Sitemap
X.Web.Sitemap copied to clipboard
Utf8 issue
Google says here: Sitemap files must be UTF-8 encoded, and URLs escaped appropriately.
This validator showed me an error until I manually programatically modified first line of xml to be utf-8 instead of 16 and extended FileSystemWrapper.cs to have Encoding.UTF8 as 3rd argument to StreamWriter.
I do it like that to get rid of xmlns:* which is not part of google search console help page and to change utf-16 to utf-8
var xmlString = xmlDocument.ToXmlString(); xmlString = Regex.Replace(xmlString, @" xmlns:.?"".?""", ""); xmlString = xmlString.Replace("encoding="utf-16"", "encoding="utf-8"");
and for file save as said FileSystemWrapper needs to be changed (highlighted part)

@ernado-x can this (especially the image) be changed any time soon?
@codingyourlife could you please provide example code where you receive utf-16?