[CXX-1652] bsoncxx::to_json() do not support GBK Created: 14/Sep/18 Updated: 27/Oct/23 Resolved: 15/Sep/18 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | BSON |
| Affects Version/s: | 3.2.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | haijiwei | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | bson, gbk | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
win10--x64-Debug mongocxx-driver-3.2.0 |
||
| Attachments: |
|
| Description |
|
New to MongoDB. I have already install mongocxx-driver-3.2.0 successfully in my PC. But when i run my code as follows, this error happened:
|
| Comments |
| Comment by A. Jesse Jiryu Davis [ 15/Sep/18 ] |
|
I'm glad you solved it! I didn't know about GBK encoding until now. As you have learned, BSON strings must be UTF8 encoded. |
| Comment by haijiwei [ 15/Sep/18 ] |
|
Ok, I use a function convert gbk to utf8 to solve it! @A. Jesse Jiryu Davis , Thanks you for your answer!! |
| Comment by haijiwei [ 14/Sep/18 ] |
|
@A. Jesse Jiryu Davis , In the Pic2 I posted, the Key-Value pair I emphasized with a red line, it seems that the value garbled in console. |
| Comment by A. Jesse Jiryu Davis [ 14/Sep/18 ] |
|
Hi. In the screenshot you attached, the JSON output looks correct to me. What error do you see? What is the driver doing that is different from what you expect it to do? |