Commit 33800c4c authored by captainwong's avatar captainwong

test unicode tool

parent d8cc5b28
......@@ -9,147 +9,164 @@ namespace win32
{
inline bool mbcs_to_u16(const char* mbcs, wchar_t* u16buffer, size_t u16size) {
size_t request_size = MultiByteToWideChar(CP_ACP, 0, mbcs, -1, NULL, 0);
if (0 < request_size && request_size < u16size) {
MultiByteToWideChar(CP_ACP, 0, mbcs, -1, u16buffer, request_size);
return true;
}
return false;
};
inline std::wstring mbcs_to_u16(const std::string& mbcs) {
//inline bool mbcs_to_u16(const char* mbcs, wchar_t* u16buffer, size_t u16size) {
// size_t request_size = MultiByteToWideChar(CP_ACP, 0, mbcs, -1, NULL, 0);
// if (0 < request_size && request_size < u16size) {
// MultiByteToWideChar(CP_ACP, 0, mbcs, -1, u16buffer, request_size);
// return true;
// }
// return false;
//};
inline std::wstring mbcs_to_utf16(const std::string& mbcs) {
std::wstring res = L"";
size_t request_size = MultiByteToWideChar(CP_ACP, 0, mbcs.c_str(), -1, NULL, 0);
if (0 < request_size) {
auto u16buffer = new wchar_t[request_size];
MultiByteToWideChar(CP_ACP, 0, mbcs.c_str(), -1, u16buffer, request_size);
res = u16buffer;
delete[] u16buffer;
auto buff = new wchar_t[request_size];
MultiByteToWideChar(CP_ACP, 0, mbcs.c_str(), -1, buff, request_size);
res = buff;
delete[] buff;
}
return res;
}
inline std::string u16_to_mbcs(const std::wstring& u16) {
inline std::string utf16_to_mbcs(const std::wstring& u16) {
std::string res = "";
size_t request_size = WideCharToMultiByte(CP_ACP, 0, u16.c_str(), -1, 0, 0, 0, 0);
if (0 < request_size) {
auto mbcs_buffer = new char[request_size];
WideCharToMultiByte(CP_ACP, 0, u16.c_str(), -1, mbcs_buffer, request_size, 0, 0);
res = mbcs_buffer;
delete[] mbcs_buffer;
auto buff = new char[request_size];
WideCharToMultiByte(CP_ACP, 0, u16.c_str(), -1, buff, request_size, 0, 0);
res = buff;
delete[] buff;
}
return res;
}
inline std::string mbcs_to_utf8(const std::wstring& mbcs) {
inline std::string utf16_to_utf8(const std::wstring& u16) {
std::string res = "";
size_t request_size = WideCharToMultiByte(CP_UTF8, 0, mbcs.c_str(), -1, 0, 0, 0, 0);
size_t request_size = WideCharToMultiByte(CP_UTF8, 0, u16.c_str(), -1, 0, 0, 0, 0);
if (0 < request_size) {
auto mbcs_buffer = new char[request_size];
WideCharToMultiByte(CP_UTF8, 0, mbcs.c_str(), -1, mbcs_buffer, request_size, 0, 0);
res = mbcs_buffer;
delete[] mbcs_buffer;
auto buff = new char[request_size];
WideCharToMultiByte(CP_UTF8, 0, u16.c_str(), -1, buff, request_size, 0, 0);
res = buff;
delete[] buff;
}
return res;
}
inline bool Utf16ToUtf8(const wchar_t* utf16String, char* utf8Buffer, size_t szBuff)
{
size_t request_size = WideCharToMultiByte(CP_UTF8, 0, utf16String, -1, NULL, 0, 0, 0);
if (1 < request_size && request_size < szBuff) {
WideCharToMultiByte(CP_UTF8, 0, utf16String, -1, utf8Buffer, request_size, 0, 0);
return true;
}
return false;
}
inline bool Utf8ToUtf16(const char* utf8String, wchar_t* utf16Buffer, size_t szBuff)
{
size_t request_size = MultiByteToWideChar(CP_UTF8, 0, utf8String, -1, NULL, 0);
if (1 < request_size && request_size < szBuff) {
MultiByteToWideChar(CP_UTF8, 0, utf8String, -1, utf16Buffer, request_size);
return true;
}
return false;
inline std::string mbcs_to_utf8(const std::string& mbcs) {
return utf16_to_utf8(mbcs_to_utf16(mbcs));
}
/**************UNICODE-ANSI mutually transform**************************/
// need be manuly delete
__forceinline LPSTR Utf16ToAnsi(const wchar_t* const wSrc)
{
char* pElementText;
int iTextLen;
iTextLen = WideCharToMultiByte(CP_ACP, 0, wSrc, -1, NULL, 0, NULL, NULL);
pElementText = new char[iTextLen + 1];
memset((void*)pElementText, 0, sizeof(char) * (iTextLen + 1));
::WideCharToMultiByte(CP_ACP, 0, wSrc, -1, pElementText, iTextLen, NULL, NULL);
return pElementText;
}
__forceinline BOOL Utf16ToAnsiUseCharArray(const wchar_t* const wSrc,
char* ansiArr, DWORD ansiArrLen)
{
int iTextLen = WideCharToMultiByte(CP_ACP, 0, wSrc, -1, NULL, 0, NULL, NULL);
if (static_cast<DWORD>(iTextLen) < ansiArrLen) {
memset((void*)ansiArr, 0, sizeof(char) * (iTextLen + 1));
::WideCharToMultiByte(CP_ACP, 0, wSrc, -1, ansiArr, iTextLen, NULL, NULL);
return TRUE;
}
return FALSE;
}
__forceinline wchar_t* AnsiToUtf16(PCSTR ansiSrc)
{
wchar_t* pWide;
int iUnicodeLen = ::MultiByteToWideChar(CP_ACP,
0, ansiSrc, -1, NULL, 0);
pWide = new wchar_t[iUnicodeLen + 1];
memset(pWide, 0, (iUnicodeLen + 1) * sizeof(wchar_t));
::MultiByteToWideChar(CP_ACP, 0, ansiSrc, -1, (LPWSTR)pWide, iUnicodeLen);
return pWide;
}
__forceinline BOOL AnsiToUtf16Array(PCSTR ansiSrc, wchar_t* warr, int warr_len)
{
int iUnicodeLen = ::MultiByteToWideChar(CP_ACP,
0, ansiSrc, -1, NULL, 0);
if (warr_len >= iUnicodeLen) {
memset(warr, 0, (iUnicodeLen + 1) * sizeof(wchar_t));
::MultiByteToWideChar(CP_ACP, 0, ansiSrc, -1, (LPWSTR)warr, iUnicodeLen);
return TRUE;
inline std::wstring utf8_to_utf16(const std::string u8) {
std::wstring res = L"";
size_t request_size = MultiByteToWideChar(CP_UTF8, 0, u8.c_str(), -1, NULL, 0);
if (0 < request_size) {
auto buff = new wchar_t[request_size];
MultiByteToWideChar(CP_UTF8, 0, u8.c_str(), -1, buff, request_size);
res = buff;
delete[] buff;
}
return FALSE;
return res;
}
__forceinline wchar_t* Utf8ToUtf16(PCSTR ansiSrc)
{
wchar_t* pWide;
int iUnicodeLen = ::MultiByteToWideChar(CP_UTF8,
0, ansiSrc, -1, NULL, 0);
pWide = new wchar_t[iUnicodeLen + 1];
memset(pWide, 0, (iUnicodeLen + 1) * sizeof(wchar_t));
::MultiByteToWideChar(CP_UTF8, 0, ansiSrc, -1, (LPWSTR)pWide, iUnicodeLen);
return pWide;
inline std::string utf8_to_mbcs(const std::string& u8) {
return utf16_to_mbcs(utf8_to_utf16(u8));
}
__inline const char* Utf16ToUtf8(const wchar_t* utf16, int& out_len)
{
out_len = ::WideCharToMultiByte(CP_UTF8, 0, utf16, -1, NULL, 0, 0, 0);
char* p8 = new char[out_len + 1];
memset(p8, 0, (out_len + 1) * sizeof(char));
::WideCharToMultiByte(CP_UTF8, 0, utf16, -1, p8, out_len, 0, 0);
return p8;
}
//
//
//inline bool Utf16ToUtf8(const wchar_t* utf16String, char* utf8Buffer, size_t szBuff)
//{
// size_t request_size = WideCharToMultiByte(CP_UTF8, 0, utf16String, -1, NULL, 0, 0, 0);
// if (1 < request_size && request_size < szBuff) {
// WideCharToMultiByte(CP_UTF8, 0, utf16String, -1, utf8Buffer, request_size, 0, 0);
// return true;
// }
// return false;
//}
//
//
//inline bool Utf8ToUtf16(const char* utf8String, wchar_t* utf16Buffer, size_t szBuff)
//{
// size_t request_size = MultiByteToWideChar(CP_UTF8, 0, utf8String, -1, NULL, 0);
// if (1 < request_size && request_size < szBuff) {
// MultiByteToWideChar(CP_UTF8, 0, utf8String, -1, utf16Buffer, request_size);
// return true;
// }
// return false;
//}
//
///**************UNICODE-ANSI mutually transform**************************/
//// need be manuly delete
//__forceinline LPSTR Utf16ToAnsi(const wchar_t* const wSrc)
//{
// char* pElementText;
// int iTextLen;
// iTextLen = WideCharToMultiByte(CP_ACP, 0, wSrc, -1, NULL, 0, NULL, NULL);
// pElementText = new char[iTextLen + 1];
// memset((void*)pElementText, 0, sizeof(char) * (iTextLen + 1));
// ::WideCharToMultiByte(CP_ACP, 0, wSrc, -1, pElementText, iTextLen, NULL, NULL);
//
// return pElementText;
//}
//
//__forceinline BOOL Utf16ToAnsiUseCharArray(const wchar_t* const wSrc,
// char* ansiArr, DWORD ansiArrLen)
//{
// int iTextLen = WideCharToMultiByte(CP_ACP, 0, wSrc, -1, NULL, 0, NULL, NULL);
// if (static_cast<DWORD>(iTextLen) < ansiArrLen) {
// memset((void*)ansiArr, 0, sizeof(char) * (iTextLen + 1));
// ::WideCharToMultiByte(CP_ACP, 0, wSrc, -1, ansiArr, iTextLen, NULL, NULL);
// return TRUE;
// }
// return FALSE;
//}
//
//__forceinline wchar_t* AnsiToUtf16(PCSTR ansiSrc)
//{
// wchar_t* pWide;
// int iUnicodeLen = ::MultiByteToWideChar(CP_ACP,
// 0, ansiSrc, -1, NULL, 0);
// pWide = new wchar_t[iUnicodeLen + 1];
// memset(pWide, 0, (iUnicodeLen + 1) * sizeof(wchar_t));
// ::MultiByteToWideChar(CP_ACP, 0, ansiSrc, -1, (LPWSTR)pWide, iUnicodeLen);
// return pWide;
//}
//
//__forceinline BOOL AnsiToUtf16Array(PCSTR ansiSrc, wchar_t* warr, int warr_len)
//{
// int iUnicodeLen = ::MultiByteToWideChar(CP_ACP,
// 0, ansiSrc, -1, NULL, 0);
// if (warr_len >= iUnicodeLen) {
// memset(warr, 0, (iUnicodeLen + 1) * sizeof(wchar_t));
// ::MultiByteToWideChar(CP_ACP, 0, ansiSrc, -1, (LPWSTR)warr, iUnicodeLen);
// return TRUE;
// }
// return FALSE;
//}
//
//__forceinline wchar_t* Utf8ToUtf16(PCSTR ansiSrc)
//{
// wchar_t* pWide;
// int iUnicodeLen = ::MultiByteToWideChar(CP_UTF8,
// 0, ansiSrc, -1, NULL, 0);
// pWide = new wchar_t[iUnicodeLen + 1];
// memset(pWide, 0, (iUnicodeLen + 1) * sizeof(wchar_t));
// ::MultiByteToWideChar(CP_UTF8, 0, ansiSrc, -1, (LPWSTR)pWide, iUnicodeLen);
// return pWide;
//}
//
//
//__inline const char* Utf16ToUtf8(const wchar_t* utf16, int& out_len)
//{
// out_len = ::WideCharToMultiByte(CP_UTF8, 0, utf16, -1, NULL, 0, 0, 0);
// char* p8 = new char[out_len + 1];
// memset(p8, 0, (out_len + 1) * sizeof(char));
// ::WideCharToMultiByte(CP_UTF8, 0, utf16, -1, p8, out_len, 0, 0);
// return p8;
//}
}
}
......@@ -303,6 +303,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_process", "test_proces
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_process_qt", "test_process_qt\test_process_qt.vcxproj", "{E287BCBE-0CA5-4E3C-9F44-05F505A5A0AA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_unicode", "test_unicode\test_unicode.vcxproj", "{897084E2-D24A-4350-95E6-5A0C204192A1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
......@@ -631,6 +633,14 @@ Global
{E287BCBE-0CA5-4E3C-9F44-05F505A5A0AA}.Release|x64.ActiveCfg = Release|Win32
{E287BCBE-0CA5-4E3C-9F44-05F505A5A0AA}.Release|x86.ActiveCfg = Release|Win32
{E287BCBE-0CA5-4E3C-9F44-05F505A5A0AA}.Release|x86.Build.0 = Release|Win32
{897084E2-D24A-4350-95E6-5A0C204192A1}.Debug|x64.ActiveCfg = Debug|x64
{897084E2-D24A-4350-95E6-5A0C204192A1}.Debug|x64.Build.0 = Debug|x64
{897084E2-D24A-4350-95E6-5A0C204192A1}.Debug|x86.ActiveCfg = Debug|Win32
{897084E2-D24A-4350-95E6-5A0C204192A1}.Debug|x86.Build.0 = Debug|Win32
{897084E2-D24A-4350-95E6-5A0C204192A1}.Release|x64.ActiveCfg = Release|x64
{897084E2-D24A-4350-95E6-5A0C204192A1}.Release|x64.Build.0 = Release|x64
{897084E2-D24A-4350-95E6-5A0C204192A1}.Release|x86.ActiveCfg = Release|Win32
{897084E2-D24A-4350-95E6-5A0C204192A1}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -702,6 +712,7 @@ Global
{65F9D4DA-BC6C-486D-8966-6ACCE077639D} = {77DBD16D-112C-448D-BA6A-CE566A9331FC}
{0F324C6A-D08E-4044-B606-E1F65DB4E68B} = {0E6598D3-602D-4552-97F7-DC5AB458D553}
{E287BCBE-0CA5-4E3C-9F44-05F505A5A0AA} = {0E6598D3-602D-4552-97F7-DC5AB458D553}
{897084E2-D24A-4350-95E6-5A0C204192A1} = {0E6598D3-602D-4552-97F7-DC5AB458D553}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A8EBEA58-739C-4DED-99C0-239779F57D5D}
......
й
\ No newline at end of file
#include "../../jlib/win32/UnicodeTool.h"
#include <stdio.h>
#include <assert.h>
using namespace jlib::win32;
int main()
{
// gb2312 ansi
// 不管cpp文件是什么编码,s1都是 CE D2 CA C7 D6 D0 B9 FA C8 CB
char s1[] = "我是中国人";
printf("s1 char:\n");
printf("%s\n", s1); // 可以打印
printf("raw %dbytes ", sizeof(s1) - 1);
for (int i = 0; i < sizeof(s1) - 1; i++) {
printf("%02X ", (unsigned char)s1[i]);
}
printf("\n\n");
// 6211 662F 4E2D 56FD 4EBA
wchar_t s2[] = L"我是中国人";
printf("s2 wchar_t:\n");
printf("%ls\n", s2); // 不可以打印
printf("raw %dbytes ", sizeof(s1) - 1);
for (int i = 0; i < sizeof(s2) / sizeof(wchar_t) - 1; i++) {
printf("%04X ", (unsigned short)s2[i]);
}
printf("\n\n");
// 6211 662F 4E2D 56FD 4EBA
auto s1u16 = mbcs_to_utf16(s1);
printf("s1u16 from mbcs_to_utf16 on s1:\n");
printf("%ls\n", s1u16.data()); // 不可以打印
printf("raw %zubytes ", s1u16.size() * sizeof(wchar_t));
for (size_t i = 0; i < s1u16.size(); i++) {
printf("%04X ", (unsigned short)s1u16[i]);
}
printf("\n\n");
// E6 88 91 E6 98 AF E4 B8 AD E5 9B BD E4 BA BA
auto s1u8 = mbcs_to_utf8(s1);
printf("s1u8 from mbcs_to_utf8 on s1:\n");
printf("%s\n", s1u8.data()); // 不可以打印
printf("raw %zubytes ", s1u8.size() * sizeof(char));
for (size_t i = 0; i < s1u8.size(); i++) {
printf("%02X ", (unsigned char)s1u8[i]);
}
printf("\n\n");
// CE D2 CA C7 D6 D0 B9 FA C8 CB
auto s2mbcs = utf16_to_mbcs(s2);
printf("s2mbcs from utf16_to_mbcs on s2:\n");
printf("%s\n", s2mbcs.data()); // 可以打印
printf("raw %zubytes ", s2mbcs.size() * sizeof(char));
for (size_t i = 0; i < s2mbcs.size(); i++) {
printf("%02X ", (unsigned char)s2mbcs[i]);
}
printf("\n\n");
// E6 88 91 E6 98 AF E4 B8 AD E5 9B BD E4 BA BA
auto s2u8 = utf16_to_utf8(s2);
printf("s2u8 from utf16_to_utf8 on s2:\n");
printf("%s\n", s2u8.data()); // 不可以打印
printf("raw %zubytes ", s2u8.size() * sizeof(char));
for (size_t i = 0; i < s2u8.size(); i++) {
printf("%02X ", (unsigned char)s2u8[i]);
}
printf("\n\n");
assert(s1u16 == s2);
assert(s1u8 == s2u8);
assert(s2mbcs == s1);
}
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{897084e2-d24a-4350-95e6-5a0c204192a1}</ProjectGuid>
<RootNamespace>testunicode</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="test_unicode.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="test_unicode.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
\ No newline at end of file
我是中国人
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment