Adding support for Unicode input files to most text file loaders (BVH and MD5 missing for now).
IrrXML receives memmapped UTF-8 input data now, it's own (faulty) conversion is not used anymore. aiString's are explicitly UTF-8 now. Slight refactorings and improvements. Adding UTF-8/UTF-16 text files for ASE,obj,collada,ac3d. These contain various japanese/chinese character sequences. Changing assimp_view's node view to display UTF-8 multibyte sequences correctly. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@469 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
@@ -101,10 +101,7 @@ void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
|
||||
throw new ImportErrorException( "OBJ-file is too small.");
|
||||
|
||||
// Allocate buffer and read file into it
|
||||
m_Buffer.resize( fileSize + 1 );
|
||||
m_Buffer[ fileSize ] = '\0';
|
||||
const size_t readsize = file->Read( &m_Buffer.front(), sizeof(char), fileSize );
|
||||
assert( readsize == fileSize );
|
||||
TextFileToBuffer(file.get(),m_Buffer);
|
||||
|
||||
//
|
||||
std::string strDirectory( 1, io.getOsSeparator() ), strModelName;
|
||||
@@ -124,6 +121,9 @@ void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
|
||||
|
||||
// And create the proper return structures out of it
|
||||
CreateDataFromImport(parser.GetModel(), pScene);
|
||||
|
||||
// Clean up allocated storage for the next import
|
||||
m_Buffer.clear();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user