[JAVA-1305] Ensure that an exception is thrown if a BSON string is not valid UTF-8 Created: 03/Jul/14 Updated: 20/Oct/20 Resolved: 20/Oct/20 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | BSON |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Jeffrey Yemin | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Description |
|
Currently the driver calls java.lang.String#String(byte[], int, int, java.lang.String) to decode UTF-8 byte arrays, but this method silently replaces invalid UTF-8 byte sequences with a replacement character. The driver should instead use CharsetDecoder directly so that an exception can be thrown instead. |
| Comments |
| Comment by Jeffrey Yemin [ 03/Jul/14 ] |
|
So .NET driver went with a client setting to allow leniency. |