-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.7.1
-
Component/s: None
-
None
The C# driver sets .NET's throwOnInvalidBytes argument to true when constructing a UTF8Encoding object. This results in exceptions being thrown when attempting to decode invalid UTF8 returned from the server.
This is generally a good thing, so this should remain the default, but there are cases where other drivers (or mongoimport) create and store UTF8 that is not 100% UTF8 compliant and it would be useful to have a setting that tells the C# driver to be more tolerant of invalid UTF8 returned from the server.
Note that round tripping a document that contains invalid UTF8 would then result in the document changing slightly, since the invalid UTF8 characters would be replaced by the Unicode character sequence for an invalid code point (\uFFFD\uFFFD). The new document would only differ where invalid code points were present, and the new document would now be 100% UTF8 compliant.
- is related to
-
JAVA-1305 Ensure that an exception is thrown if a BSON string is not valid UTF-8
- Closed
- related to
-
PYTHON-721 BSON Errors with invalid utf8 strings.
- Closed