[SERVER-5597] Windows implementation of toWideString in text.cpp is incorrect. Created: 13/Apr/12 Updated: 11/Jul/16 Resolved: 06/May/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 2.1.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andy Schwerin | Assignee: | Tad Marshall |
| Resolution: | Done | Votes: | 0 |
| Labels: | Windows | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows |
||
| Operating System: | Windows |
| Participants: |
| Description |
|
Strings composed of sequences chars in the mongo code base are presumed to be UTF-8 encoded, but the implementation of toWideString converts based on the current process code page, which in client code may not be UTF-8. The correct implementation should always convert UTF-8 to wchar_t (UTF-16 on Windows Vista and later, I believe). |
| Comments |
| Comment by auto [ 06/May/12 ] |
|
Author: {u'login': u'tadmarshall', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}Message: Use MultiByteToWideChar to convert UTF-8 to UTF-16 on Windows. |
| Comment by Tad Marshall [ 16/Apr/12 ] |
|
This is a rewrite of a one line routine that really needs to be seven lines. Pretty much boilerplate. |