[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: SERVER-5597 Rewrite toWideString (Windows-only)

Use MultiByteToWideChar to convert UTF-8 to UTF-16 on Windows.
Branch: master
https://github.com/mongodb/mongo/commit/fed63e0abb8bfefeb1d4cd8e5e065019ccab9307

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.

Generated at Thu Feb 08 03:09:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.