怎么在华为防火墙做网站映射,网站方案制作的培训,广州今天新闻,pageadmin系统Ogre的文件读取是使用的标准库的io库读取的#xff0c;众所周知的是#xff0c;在vs2005是存在着bug的。因此想要一劳永逸的解决这个办法唯有去修改Ogre的源代码#xff0c;以下为修改方法#xff1a;打开OgreFileSystem.cpp文件#xff0c;找到FileSystemArchive::open方…Ogre的文件读取是使用的标准库的io库读取的众所周知的是在vs2005是存在着bug的。因此想要一劳永逸的解决这个办法唯有去修改Ogre的源代码以下为修改方法打开OgreFileSystem.cpp文件找到FileSystemArchive::open方法使用以下代码替换之DataStreamPtr FileSystemArchive::open(const String filename) const { String full_path concatenate_path(mName, filename); // Use filesystem to determine size // (quicker than streaming to the end and back) struct stat tagStat; int ret stat(full_path.c_str(), tagStat); assert(ret 0 Problem getting file size ); // Always open in binary mode static std::vectorwchar_t s_wchar_buf((size_t)128); size_t lengthUnicode MultiByteToWideChar(CP_ACP, 0, full_path.c_str(), full_path.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, full_path.c_str(), full_path.size(), szUnicode, lengthUnicode); szUnicode[lengthUnicode] 0; std::ifstream* origStream new std::ifstream(); origStream-open(szUnicode, std::ios::in | std::ios::binary); // Should check ensure open succeeded, in case fail for some reason. if (origStream-fail()) { delete origStream; OGRE_EXCEPT(Exception::ERR_FILE_NOT_FOUND, Cannot open file: filename, FileSystemArchive::open); } /**//// Construct return stream, tell it to delete on destroy FileStreamDataStream* stream new FileStreamDataStream(filename, origStream, tagStat.st_size, true); return DataStreamPtr(stream); } posted on 2008-12-09 03:42 杨粼波 阅读(957) 评论(2) 编辑 收藏 引用 Feedbackre: Ogre读取中文路径名的文件失败的解决办法 2010-09-05 19:16 用setlocale(LC_ALL,Chinese-simplified);就可以了。 re: Ogre读取中文路径名的文件失败的解决办法[未登录] 2010-09-12 00:56 你知道setlocale这个方法的代价有多大么会带来什么影响么 转载于:https://www.cnblogs.com/lancidie/archive/2011/04/23/2025572.html