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

Can't import template if folder contains non-ascii characters #1708

Closed
bussiere opened this issue Apr 18, 2015 · 4 comments
Closed

Can't import template if folder contains non-ascii characters #1708

bussiere opened this issue Apr 18, 2015 · 4 comments

Comments

@bussiere
Copy link

same as here 👍 http://www.godotengine.org/forum/viewtopic.php?f=11&t=1292

Can't open it event if i renamed it as a zip ...

http://i.imgur.com/6cf9R4Y.png

Regards

@akien-mga
Copy link
Member

The screenshot shows that there is an encoding issue with your "Téléchargements" folder. Do you manage to import the templates if you place the archive in ~ instead of ~/Téléchargements?

@akien-mga akien-mga changed the title can't open export template can't open export template if folder contains non-ascii characters Nov 22, 2015
@akien-mga akien-mga changed the title can't open export template if folder contains non-ascii characters Can't import template if folder contains non-ascii characters Nov 22, 2015
@Calinou
Copy link
Member

Calinou commented Nov 22, 2015

I can reproduce this on Fedora 22, with self-built Godot Git (dated 2015-11-21).

Importing the templates works if I put the templates in "Bureau", but not in "Téléchargements" (my system is French).

@vnen
Copy link
Member

vnen commented Jun 17, 2016

This is because of UTF-8 encoding problem in String. I think it's trying to double convert to UTF-8 (or converting something that already is). And it doesn't work on Windows either.

@akien-mga akien-mga self-assigned this Jun 18, 2016
@akien-mga
Copy link
Member

akien-mga commented Jun 18, 2016

I confirm @vnen's analysis, the bug happens at https://github.com/godotengine/godot/blob/c3bf11d/tools/editor/editor_node.cpp#L1282 where p_file.utf8().get_data() apparently introduces an encoding bug when parsing something like Téléchargements.

We can't just pass p_file though as the function expects a const char*.

As an example, I get this:

print_line(p_file)  // /home/akien/Téléchargements/templates.tpz
print_line(p_file.utf8().get_data())  // /home/akien/Tlchargements/templates.tpz

@reduz reduz closed this as completed in 1c541a2 Jun 18, 2016
@akien-mga akien-mga assigned reduz and unassigned akien-mga Jun 18, 2016
akien-mga pushed a commit that referenced this issue Jul 8, 2016
this probably failed when exporting or opening android apk files too, should fix that too.

(cherry picked from commit 1c541a2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants