C++ Utf-8 conversion using atlconv.h / W2A and Chinese texts - by Tarmo Pikaro

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


2
0
Sign in
to vote
ID 2565433 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 4/8/2016 5:26:24 AM
Access Restriction Public

Description

http://stackoverflow.com/questions/36497069/c-utf-8-conversion-using-atlconv-h-w2a-and-chinese-texts

This is a bug, identified IDE's are at least 2010 - 2013. Haven't checked newer ones. 

Is it possible to fix this issue permanently and into all Visual studio's potentially ? Should be relatively small bugfix ?!
Sign in to post a comment.
Posted by Microsoft on 4/22/2016 at 8:58 AM
Hi Tarmo,

Thanks you for spending the time to report this issue our way.

The solution for this issue is to make use of ATL and MFC 7.0 string conversions (https://msdn.microsoft.com/en-us/library/87zae4a3.aspx), which support conversion to user-specified code pages beyond system code pages (which are limited to DBCS encodings). These were introduced in Visual Studio .NET 2002 and have shipped in all subsequent versions of Visual Studio. You can find additional details regarding the introduction of ATL and MFC 7.0 string conversions at https://msdn.microsoft.com/en-us/library/w1sc4t4k(v=vs.90).aspx.

User code converting to UTF-8 (a multi-byte encoding) must use the ATL and MFC 7.0 string conversions. We'll update documentation to ensure this is clearly stated.

Thanks,
Daniel Griffing
Visual C++ Libraries