[SERVER-16725] Incorrect character conversion between UTF-8 and UTF-16 Created: 05/Jan/15 Updated: 08/Jan/24 Resolved: 16/Sep/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 3.3.14 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Spencer Jackson | Assignee: | Mark Benvenuto |
| Resolution: | Done | Votes: | 0 |
| Labels: | 28qa, locale, utf-8 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||
| Operating System: | Windows | ||||||||||||||||||||||||
| Steps To Reproduce: | On Windows, start a mongod with directoryperdb. Create a database with a single multibyte UTF-8 character as its name. Insert a document. |
||||||||||||||||||||||||
| Sprint: | Platforms 2016-08-26, Platforms 2016-09-19 | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Description |
|
The use of UTF-8 unicode characters in a database name will cause creation of directories with directoryperdb to fail. Because the BSON spec defines strings to be stored in UTF-8, strings in the Because two mechanisms are used, it appears that we are creating an incorrect directory name, using boost::filesystem::path, creating that incorrect directory, then attempting to create a file in the correct path. The directory in the file path will not exist, and file creation will fail. FileAllocator's makeTempFileName and run functions will need to be modified. makeTempFileName produces a path as a string. Though it uses boost::filesystem::path internally, it translates the path back into 8 bit characters when it converts to std::string. run then uses c_str on said std::string without any width conversion. A plausible solution to this might be to use boost's locale library to generate a new std::locale object with a correct codecvt, as per the |
| Comments |
| Comment by Githook User [ 16/Sep/16 ] |
|
Author: {u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}Message: |