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:
aramis_acg
2009-08-21 22:49:58 +00:00
parent 3b95a1e782
commit a251827cb9
37 changed files with 2638 additions and 208 deletions

View File

@@ -90,25 +90,25 @@ void OFFImporter::GetExtensionList(std::string& append)
// ------------------------------------------------------------------------------------------------
// Imports the given file into the given scene structure.
void OFFImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
// Check whether we can read from the file
if( file.get() == NULL)
if( file.get() == NULL) {
throw new ImportErrorException( "Failed to open OFF file " + pFile + ".");
unsigned int fileSize = (unsigned int)file->FileSize();
}
// allocate storage and copy the contents of the file to a memory buffer
std::vector<char> mBuffer2(fileSize+1);
file->Read(&mBuffer2[0], 1, fileSize);
mBuffer2[fileSize] = '\0';
std::vector<char> mBuffer2;
TextFileToBuffer(file.get(),mBuffer2);
const char* buffer = &mBuffer2[0];
char line[4096];
GetNextLine(buffer,line);
if ('O' == line[0])GetNextLine(buffer,line); // skip the 'OFF' line
if ('O' == line[0]) {
GetNextLine(buffer,line); // skip the 'OFF' line
}
const char* sz = line; SkipSpaces(&sz);
const unsigned int numVertices = strtol10(sz,&sz);SkipSpaces(&sz);