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

Fix #19 Can't open project (with non-ASCII path) #118

Merged
merged 1 commit into from
Feb 18, 2014

Conversation

Terseus
Copy link
Contributor

@Terseus Terseus commented Feb 18, 2014

In class OS_Unix the arguments in the execute method are converted
to UTF-8, but in the main program's method they're inserted into a
wide-char Vector before translating them from UTF-8 and thus the
non-ASCII characters are lost.

This fix converts the argv elements to UTF-8 using String::utf8
before inserting them in the Vector.

Tested in Archlinux x86_64.

Please test this change in Windows with a non-UTF-8 encoding (e.g. ISO-8859-15), it may break Windows-only behavior because the execute method in class OS_Windows doesn't convert the arguments to UTF-8.

In `class OS_Unix` the arguments in the `execute` method are converted
to UTF-8, but in the `main` program's method they're inserted into a
wide-char `Vector` before translating them from UTF-8 and thus the
non-ASCII characters are lost.

This fix converts the `argv` elements to UTF-8 using `String::utf8`
before inserting them in the `Vector`.
@kd7tck
Copy link

kd7tck commented Feb 18, 2014

Tested in windows 8.1, I created a folder named Ŝsdfsd, then I placed a project into it. I dragged and dropped the .scn project file from this directory onto the recompiled godot.exe. This was recompiled with your patch, it crashed. On the other hand when I remove the Ŝ from the folder name it works.

wmain() is the only reliable fix for this on windows.

reduz added a commit that referenced this pull request Feb 18, 2014
Fix #19 Can't open project (with non-ASCII path)
@reduz reduz merged commit f0e6ed1 into godotengine:master Feb 18, 2014
@reduz
Copy link
Member

reduz commented Feb 18, 2014

thanks!

@Terseus
Copy link
Contributor Author

Terseus commented Feb 18, 2014

@kd7tck I'm not sure if my patch affects your use-case, I don't know if godot forks itself when a scene is drag-n-drop'd inside it (and thus yes, the use-case is affected by this patch) or what happens.
Unfortunately I'm not a Windows guy, but if you think that my patch really breaks Windows-only behavior please open a new issue and I will see what I can do.

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 this pull request may close these issues.

3 participants