Skip to content

Commit

Permalink
toLatin1 -> toLocal8Bit. Supports whatever encoding is used by the sy…
Browse files Browse the repository at this point in the history
…stem.
  • Loading branch information
ponchio committed Apr 5, 2024
1 parent 9861a99 commit 877287e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/nxsbuild/plyloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ PlyLoader::PlyLoader(QString filename):
current_triangle(0),
current_vertex(0) {

int val = pf.Open(filename.toLatin1().data(), PlyFile::MODE_READ);
int val = pf.Open(filename.toLocal8Bit().data(), PlyFile::MODE_READ);
if(val == -1) {
int error = pf.GetError();
throw QString("could not open file " + filename + ". Error: %1").arg(error);
Expand All @@ -139,7 +139,7 @@ PlyLoader::PlyLoader(QString filename):
if(bufstr[i]!='\t' && bufstr[i]>=32 && bufstr[i]<=126 ) bufclean.push_back(bufstr[i]);

char buf2[255];
ply::interpret_texture_name( bufclean.c_str(),filename.toLatin1().data(), buf2, 255);
ply::interpret_texture_name( bufclean.c_str(),filename.toLocal8Bit().data(), buf2, 255);
LoadTexture tex;
tex.filename = QString(buf2).trimmed();
texture_filenames.push_back(tex);
Expand Down
2 changes: 1 addition & 1 deletion src/nxsbuild/tmesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using namespace std;

void TMesh::loadPly(const QString& filename) {
int loadmask = 0;
vcg::tri::io::ImporterPLY<TMesh>::Open(*this, filename.toLatin1().data(), loadmask);
vcg::tri::io::ImporterPLY<TMesh>::Open(*this, filename.toLocal8Bit().data(), loadmask);
vcg::tri::UpdateNormal<TMesh>::PerVertexNormalized(*this);
vcg::tri::UpdateNormal<TMesh>::PerFaceNormalized(*this);
}
Expand Down

0 comments on commit 877287e

Please sign in to comment.