admin管理员组

文章数量:1336204

So I've uploaded a game on itch.io. This is the link to the game in case anyone has to check it.

Inside the SETTINGS, there's an option to change the game language. The first time I uploaded it to itch.io, all the Japanese texts where broken, because of a bug known in Japanese as "mojibake": when the software doesn't know the right character-encoding of your text, it may show weird characters in its place instead.

Usually we fix this in webpages by adding a <meta charset="utf-8"> inside the HTML file, but since this didn't work for my Godot game, I've tried a fix suggested by this video and added a custom font project-wide (Project settings > GUI Themes > Custom Fonts); this time, the font can't deal with the accented Portuguese alfabets (such as á and ê).

I don't know why but this bug only affects the web export of the project, not the Android export (.apk) or the Windows export (.exe).

So what's the best approach to take here?

So I've uploaded a game on itch.io. This is the link to the game in case anyone has to check it.

Inside the SETTINGS, there's an option to change the game language. The first time I uploaded it to itch.io, all the Japanese texts where broken, because of a bug known in Japanese as "mojibake": when the software doesn't know the right character-encoding of your text, it may show weird characters in its place instead.

Usually we fix this in webpages by adding a <meta charset="utf-8"> inside the HTML file, but since this didn't work for my Godot game, I've tried a fix suggested by this video and added a custom font project-wide (Project settings > GUI Themes > Custom Fonts); this time, the font can't deal with the accented Portuguese alfabets (such as á and ê).

I don't know why but this bug only affects the web export of the project, not the Android export (.apk) or the Windows export (.exe).

So what's the best approach to take here?

Share Improve this question asked Nov 19, 2024 at 20:34 Gui ImamuraGui Imamura 72212 silver badges33 bronze badges 2
  • No idea whether relevant, but your <meta charset...> is specific to HTML 5, guaranteed by <!DOCTYPE HTML>. – Joop Eggen Commented Nov 19, 2024 at 22:47
  • @JoopEggen Itch.io automatically creates that declaration on the top of the HTML file and I don't think I can edit that. Nonetheless, wouldn't the game itself be affected by that as well? – Gui Imamura Commented Nov 20, 2024 at 1:10
Add a comment  | 

1 Answer 1

Reset to default 0

Someone else has suggested me (in the Japan Godot forum) to use a Google font, because it has both Japanese and accented alfabet character-sets. It fixed my bug. I would still accept another answer as the correct one if someone knows how to fix it without forcing the use of a specific font.

本文标签: godot4Encoding characters correctly in a Godot Project exported for WebStack Overflow