umbraco/Umbraco-CMS — pull request #446 by nul800sebastiaan (2014-08-12 12:25:08+00:00)
Title: U4-2238 6.0.5 - Issue when saving/publishing special characters - '' hexadecimal value 0x03, is an invalid character

Proposed solution for this issue, I think I covered every entity and every property that could reasonably contain invalid characters.
Seems like a bit of repetition is slipping in but I'm not sure how to avoid that. I'm also not sure what the "best practice" for tags and dictionary items would be, so I'd be happy to update this PR after feedback.

We used to do something similar in v4:
RemoveIllegalXmlCharacters in https://umbraco.codeplex.com/SourceControl/changeset/view/923aac036b1e#src/umbraco.cms/businesslogic/datatype/DefaultData.cs
https://umbraco.codeplex.com/SourceControl/changeset/view/923aac036b1e#src/umbraco.cms/helpers/xhtml.cs

This got removed somehow, so this is a new and improved version of that.