[GODRIVER-1532] Allow invalid UTF-8 strings to be decoded Created: 12/Mar/20  Updated: 28/Oct/23  Resolved: 12/Mar/20

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.3.2

Type: Bug Priority: Major - P3
Reporter: Divjot Arora (Inactive) Assignee: Divjot Arora (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to TOOLS-2514 Upgrade tools to go driver 1.3.2 Closed
Case:

 Description   

When decoding a string in BSON, the driver attempts to validate that the string is valid UTF-8, which can cause issues if the data in the database is actually invalid. We should allow users to read out that data, despite it being invalid, because Go strings are just bytes and don't conform to a specific charset.

 

The existing check is also incorrect because it's only checking single-byte strings, but multi-byte strings can be invalid UTF-8 as well.



 Comments   
Comment by Githook User [ 12/Mar/20 ]

Author:

{'username': 'divjotarora', 'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com'}

Message: GODRIVER-1532 Remove check when decoding invalid UTF-8 strings (#333)
Branch: release/1.3
https://github.com/mongodb/mongo-go-driver/commit/fd24d6f38bc7940bf61169c881f534d9f51d3434

Comment by Githook User [ 12/Mar/20 ]

Author:

{'username': 'divjotarora', 'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com'}

Message: GODRIVER-1532 Remove check when decoding invalid UTF-8 strings (#333)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/6c9751b331df124b8ada3b4825be8c60a453e544

Comment by Divjot Arora (Inactive) [ 12/Mar/20 ]

https://github.com/mongodb/mongo-go-driver/pull/333

Generated at Thu Feb 08 08:36:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.