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

推荐订阅源

K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
A
About on SuperTechFans
WordPress大学
WordPress大学
I
InfoQ
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
Hugging Face - Blog
Hugging Face - Blog
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
Recorded Future
Recorded Future
D
DataBreaches.Net
大猫的无限游戏
大猫的无限游戏
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
aimingoo的专栏
aimingoo的专栏
月光博客
月光博客
罗磊的独立博客
博客园 - 叶小钗
量子位
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
The Blog of Author Tim Ferriss
Vercel News
Vercel News
G
Google Developers Blog
F
Fortinet All Blogs
博客园 - 三生石上(FineUI控件)
Microsoft Security Blog
Microsoft Security Blog
Engineering at Meta
Engineering at Meta
IT之家
IT之家
S
SegmentFault 最新的问题
B
Blog RSS Feed
MyScale Blog
MyScale Blog
Jina AI
Jina AI
The Register - Security
The Register - Security
Stack Overflow Blog
Stack Overflow Blog
博客园 - Franky
Attack and Defense Labs
Attack and Defense Labs
Webroot Blog
Webroot Blog
H
Hacker News: Front Page
C
Check Point Blog
博客园_首页
云风的 BLOG
云风的 BLOG
Recent Announcements
Recent Announcements
Schneier on Security
Schneier on Security
T
Tailwind CSS Blog
The Last Watchdog
The Last Watchdog
宝玉的分享
宝玉的分享
B
Blog
O
OpenAI News
博客园 - 【当耐特】
有赞技术团队
有赞技术团队
D
Docker

博客园 - 涛仔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);