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

推荐订阅源

D
Darknet – Hacking Tools, Hacker News & Cyber Security
Jina AI
Jina AI
博客园_首页
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
L
Lohrmann on Cybersecurity
Forbes - Security
Forbes - Security
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News
Y
Y Combinator Blog
Google DeepMind News
Google DeepMind News
The Register - Security
The Register - Security
N
News | PayPal Newsroom
S
Security Archives - TechRepublic
量子位
Cisco Talos Blog
Cisco Talos Blog
V
V2EX
C
Cisco Blogs
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog
L
LangChain Blog
Scott Helme
Scott Helme
S
Securelist
Security Latest
Security Latest
爱范儿
爱范儿
TaoSecurity Blog
TaoSecurity Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
I
Intezer
L
LINUX DO - 最新话题
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Check Point Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
美团技术团队
Know Your Adversary
Know Your Adversary
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
PCI Perspectives
PCI Perspectives
月光博客
月光博客
T
Tailwind CSS Blog
Cloudbric
Cloudbric
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
K
Kaspersky official blog
D
DataBreaches.Net
博客园 - 【当耐特】
有赞技术团队
有赞技术团队

博客园 - zhucde

一句话的解释 给场景添加一个背景 ATI显卡中不能使用CG的变态原因 ORA-28000: the account is locked Oracle10g, EM中,ERROR: Wrong password for user ActiveX中嵌入Flash, 在IE中调用时, 与Flash的交互问题 子节点(ChildNode)设置WorldPostion [转贴]c/c++ struct union 对齐方式 OpenGL程序 转为Opengl ES 的一点建议glDrawArray和glDrawElements [陆续更新] IPhone中编译Ogre源码及使用 宏定义中"#"的用法 - zhucde - 博客园 Ogre控件在网页中调用的问题 在3D中, 将世界坐标映射为屏幕上的坐标点 更新一下道路的最新效果,处理了边缘, 加入了Shader光照 OGRE中新做的火焰和爆炸 刚刚从CSDN的博客搬家过来, 有些文章的内容逐步完善, 请多多谅解! 在Ogre中使用DirectShow来播放视频--重新封装并测试通过(已完整) 新加的一个天空的效果. (已完整) [OGRE]继续完善道路-----道路两侧物体匹配(已完整)
Ogre中解决中文路径和中文文件名的方法
zhucde · 2011-03-11 · via 博客园 - zhucde

平时嫌麻烦, 一般采用setlocale(LC_ALL,"Chinese-simplified"); 的方法, 基本也能解决问题, 虽然很多人说这个方法不好 , 懒的管了.

可当把程序设置为" 在静态库中使用MFC"时, 这个方法就不灵了, 如该链接中:http://blog.csdn.net/pizi0475/archive/2010/03/01/5335677.aspx,  提到的方法都不能解决问题.

网上查了多种方法, 测试发现这种方法是有效的:

WCHAR * MtoW(const char* str)
	{
		WCHAR*     strA;       
		int i= MultiByteToWideChar(CP_ACP,0 ,(char*)str,-1,NULL,0);  

		strA = new WCHAR[i];       
		MultiByteToWideChar(CP_ACP,0,(char*)str,-1,strA,i);      

		return strA;
	}

在OgreFileSystem.cpp的

DataStreamPtr FileSystemArchive::open(const String& filename) const 函数中:

origStream->open(MtoW(full_path.c_str()), std::ios::in | std::ios::binary);  //使用MtoW转换一下

Everything is all righit.