我问这个更多是出于好奇。
考虑以下代码片段:
CStringA narrow;
CStringW wide;
...
wide = narrow; // which code page is used for the conversion
// of the narrow string to wide string?
字符串
哪个代码页用于将CStringA
字符串转换为CStringW
?它似乎使用CP_ACP
代码页,但这能保证吗?
我实际上使用的是wide = CA2W(narrow, CP_ACP);
而不是wide = narrow;
,这样我就可以显式地指定所需的代码页。
免责声明:我知道宽字符串应该在所有地方使用,但这是用于MBCS遗留软件。
1条答案
按热度按时间yacmzcpb1#
ATL是开源的。ATL
StringT
使用_AtlGetConversionACP()
:字符串