感谢互联网。

 

static std::vector<wchar_t>     s_wchar_buf((size_t)128);
    size_t lengthUnicode 
= MultiByteToWideChar(CP_ACP, 0, strFileName.c_str(), strFileName.size(), NULL, 0);
    
if (s_wchar_buf.size() < lengthUnicode + 1)
    {
        s_wchar_buf.resize(lengthUnicode 
* 2);
    }
    wchar_t
* szUnicode = &s_wchar_buf[0];
    MultiByteToWideChar(CP_ACP, 
0, strFileName.c_str(), strFileName.size(), szUnicode, lengthUnicode);
    szUnicode[lengthUnicode] 
= 0;

    ifstream ifs(szUnicode, ios::
in|ios::ate);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2022-02-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-29
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2021-07-07
  • 2022-02-08
相关资源
相似解决方案