[CDRIVER-1503] Libbson doesn't handle special characters correctly Created: 30/Aug/16  Updated: 03/May/17  Resolved: 30/Aug/16

Status: Closed
Project: C Driver
Component/s: libbson
Affects Version/s: 1.3.5
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Almansour Belleh Blanco [X] Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: crash, driver
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows, Visual studio 2013/2015


Attachments: Text File bson_special_char.c    

 Description   

libbson doesn't handle special characters, like é, ö, ü...
The attached code will cause an error even though libbson is supposed to handle utf8



 Comments   
Comment by A. Jesse Jiryu Davis [ 30/Aug/16 ]

The example file you shared with us contains a string the begins with "charit" and ends with the byte 0xE9, followed by a backslash and close quote.

0xE9 isn't valid utf8 on its own, its high bit is set which means it must be part of a multi-byte code.

https://en.wikipedia.org/wiki/UTF-8#Description

Generated at Wed Feb 07 21:12:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.