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

Unable to load file with non-ASCII name via Bytes.fromFile on Mac/Linux target #1624

Closed
tobil4sk opened this issue Jan 24, 2023 · 4 comments · Fixed by #1472
Closed

Unable to load file with non-ASCII name via Bytes.fromFile on Mac/Linux target #1624

tobil4sk opened this issue Jan 24, 2023 · 4 comments · Fixed by #1472

Comments

@tobil4sk
Copy link
Member

For example, this returns null when the file clearly exists:

lime.utils.Bytes.fromFile("/home/user/é.txt"); // null

Files with ASCII names load fine:

lime.utils.Bytes.fromFile("/home/user/e.txt"); // returns correct contents

This function ends up using SDL_RWFromFile:

result = SDL_RWFromFile (filename, mode);

According to the documentation of this function, it should support utf8... so I'm not sure what exactly is going wrong here. See: https://wiki.libsdl.org/SDL2/SDL_RWFromFile

@tobil4sk
Copy link
Member Author

So, it seems HXCPP uses UTF16 for unicode strings, so that would make sense why it doesn't work if UTF8 is expected.

Looks like this problem was solved for Windows but never for Unix systems:
7a3b9f6#diff-32f7dcd12e1b85aaef9967aba781da613f5e834c9934b9fed994eb6b368813bdR634-R636

@tobil4sk
Copy link
Member Author

#1472 seems to resolve this issue.

@Shallowmallow
Copy link

Oh it's kind of important. Wonder why it hasn't been merged.

@tobil4sk
Copy link
Member Author

tobil4sk commented Feb 3, 2023

Yes, hopefully it can be merged soon.

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

Successfully merging a pull request may close this issue.

2 participants