From Farshid Lashkari, "I modified some plugins to use the osgDB file stream functions in order to support UTF-8 encoded filenames."

This commit is contained in:
Robert Osfield
2010-05-13 11:01:06 +00:00
parent 29ea65c12b
commit 4e8f0561ad
20 changed files with 34 additions and 33 deletions

View File

@@ -702,7 +702,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriter3DS::readNode(const std::string& fil
// Do not use the lib3ds_file_open() as:
// 1. It relies on FILE* instead of iostreams (less safe)
// 2. It doesn't allow us to set a custom log output
std::ifstream fin(fileName.c_str(), std::ios_base::in | std::ios_base::binary);
osgDB::ifstream fin(fileName.c_str(), std::ios_base::in | std::ios_base::binary);
if (!fin.good()) return ReadResult::ERROR_IN_READING_FILE;
return doReadNode(fin, options, fileName);
/*
@@ -1139,7 +1139,7 @@ osgDB::ReaderWriter::WriteResult ReaderWriter3DS::writeNode(const osg::Node& nod
if (!acceptsExtension(ext)) return WriteResult::FILE_NOT_HANDLED;
osgDB::makeDirectoryForFile(fileName.c_str());
std::ofstream fout(fileName.c_str(), std::ios_base::out | std::ios_base::binary);
osgDB::ofstream fout(fileName.c_str(), std::ios_base::out | std::ios_base::binary);
if (!fout.good()) return WriteResult::ERROR_IN_WRITING_FILE;
return doWriteNode(node, fout, options, fileName);
/*