ArgumentException when writing strings with control characters
yv989c opened this issue · 0 comments
yv989c commented
The XML 1.0 spec which is used by the underline XmlWriter does not allow some control characters and may be others.
I don't think that the current runtime exception provides a good UX.
Some options:
- Translate these invalid XML characters to a common placeholder.
- Remove these invalid XML characters from the string.
I believe this is a corner case though but is still a limitation because these characters can be stored using the varchar
and nvarchar
data types in SQL Server.
Relevant info: https://stackoverflow.com/a/28152666/2206145