How can output filename include UTF8 Text?
My code output text to 1 file:
If FileName not include UTF8 Text (Ex: 1.html), it output OK,
But FileName include UTF8 Text (Ex: 名称未設定-1.indd_1.html), it can't create file.
How can output filename include UTF8 Text?
WideString strContent=WideString("test名称未設定");
PMString filename="C:/Users/pc1/Desktop/cc/名称未設定-1.indd_1.html";
std::string utf8StdStr;
StringUtils::ConvertWideStringToUTF8(strContent, utf8StdStr);
std::string strfile;
StringUtils::ConvertWideStringToUTF8(WideString(filename), strfile);
std::ofstream fileOut(strfile);
if (!fileOut)
{
ASSERT_FAIL("ofstream failed.");
break;
}
fileOut << utf8StdStr;
fileOut.close();
