Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle special characters in filenames #168

Open
zoltan-mihalyi opened this issue Mar 31, 2024 · 3 comments
Open

handle special characters in filenames #168

zoltan-mihalyi opened this issue Mar 31, 2024 · 3 comments

Comments

@zoltan-mihalyi
Copy link

zoltan-mihalyi commented Mar 31, 2024

Nexus cannot handle file names with special characters.

nxsbuild a.obj # OK
cp a.obj $(echo -n oC5vYmo= | base64 -d) # make a copy with a special filename
nxsbuild $(echo -n oC5vYmo= | base64 -d) # ERROR

Fatal error: could not open file �.obj. Error: No such file or directory

Other programs can open the file

@ponchio
Copy link
Contributor

ponchio commented Apr 5, 2024

I think this is a limitation of Qt and how qstring handles content. It seems to work with utf8 encoding but not with invalid encodings. Could not find info on the web about this issue.
In order to fix this issue I would have to replace all references to QFile (which takes a QString in input). Is it really needed?

@zoltan-mihalyi
Copy link
Author

I was wonderinf it is caused by the .toLatin1() calls in nexus source code.

I develop an application which uses nexus and I can not conrol the filenames of my users, and I haven't found any workaround. If I rename the file, I should also rename the texture and the reference to it, which seems to be a big headache

@ponchio
Copy link
Contributor

ponchio commented Apr 5, 2024

Latin1 seems to appear only in the .ply loader due to the fact that the lib requires a char *, and it's most probably wrong going back and forward through a qstring.
The .obj loader instead convert char * to string and uses qfile, , so no toLatin1 calls and with valid utf8 characters it seems to properly work.

So: if the problem is with .obj than most probably the culprit is the encoding, if the problem is with .ply it is my fault (and I will fix it removing the qstring middleman).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants