惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Securelist
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
A
About on SuperTechFans
S
Security @ Cisco Blogs
L
LangChain Blog
Cloudbric
Cloudbric
B
Blog
Google Online Security Blog
Google Online Security Blog
I
InfoQ
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
GbyAI
GbyAI
WordPress大学
WordPress大学
月光博客
月光博客
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
小众软件
小众软件
Cyberwarzone
Cyberwarzone
Martin Fowler
Martin Fowler
AWS News Blog
AWS News Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
PCI Perspectives
PCI Perspectives
T
The Exploit Database - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
CERT Recently Published Vulnerability Notes
博客园 - 司徒正美
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
F
Full Disclosure
P
Palo Alto Networks Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
V2EX - 技术
V2EX - 技术
G
GRAHAM CLULEY
T
Threat Research - Cisco Blogs
P
Privacy International News Feed
S
Schneier on Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Attack and Defense Labs
Attack and Defense Labs
V
Visual Studio Blog
N
News and Events Feed by Topic
C
Cybersecurity and Infrastructure Security Agency CISA
S
Security Affairs
Spread Privacy
Spread Privacy
Vercel News
Vercel News
量子位
Apple Machine Learning Research
Apple Machine Learning Research
Security Latest
Security Latest
T
The Blog of Author Tim Ferriss
IT之家
IT之家
Stack Overflow Blog
Stack Overflow Blog

博客园 - 涛仔28

Unreal Engine Plugin management HYPE若干经验 总结SQLExpress2008安装 如何使用子程序参数--摘自代码大全2 WinDBG咒语 SunFlow渲染流程的设计 SunFlow场景文件的Instances代码块摘要 SunFlow场景文件的GI代码块摘要 SunFlow场景文件的Cameras代码块摘要 SunFlow场景文件的Object代码块 SunFlow场景文件的Modifiers代码块 - 涛仔28 - 博客园 SunFlow场景文件的Shader代码块 - 涛仔28 - 博客园 SunFlow场景文件的Light代码块 SunFlow场景文件的Image代码块 SunFlow场景文件的代码顺序 关于Ext3.0释出 函数的连续性 关于JSON的大文本处理 脚本的杂乱思路
转 ifstream 读取中文路径
涛仔28 · 2010-09-10 · via 博客园 - 涛仔28

感谢互联网。

代码

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);