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

in-game console can't handle diacritics #60

Open
BozoDel opened this issue Jan 23, 2014 · 10 comments
Open

in-game console can't handle diacritics #60

BozoDel opened this issue Jan 23, 2014 · 10 comments

Comments

@BozoDel
Copy link
Contributor

BozoDel commented Jan 23, 2014

I recently started a Brazilian Portuguese translation of this game. While I was testing Tutorial 1, I came across a bug. I tell the player to add the command "print("Olá, trAIns")", and instead of printing it, I get the following error message:

Could not execute script: (TutorialAI1.lua): Scripts/console.lua:54: Not enough space
5: [/home/bozodel//.local/share//love/trAInsported/AI/TutorialAI1.lua]: line 11
6: [=[C]]: line -1
7: [@Scripts/ai.lua]: line 98

I read somewhere that this might be an issue with the engine? Could it have been fixed in 0.9.0?

I can get around that for the tutorial, replacing "Olá" with "Oi", but the player will eventually use diacritics and won't know what to do. If it's impossible to fix the issue, then maybe we can give people an error message telling them to remove diacritics?

P.S.: Is that why the tutorial translations haven't actually been implemented?

@Germanunkol
Copy link
Owner

Hi,

Yes, if I recall correctly this should be fixed with the new engine version. I am going to port it, hopefully soon. With a bit of luck, it will happen within the next week. The new engine version has only been out for about a month and I didn't get around to porting it yet.
And yes, this is also part of the reason why the translations have not all been implemented and shipped.
If you want to, maybe wait for a few days and let me port the game?
Thanks for taking the time to translate it!

@BozoDel
Copy link
Contributor Author

BozoDel commented Jan 24, 2014

You're welcome! But hmyeah, maybe I should wait.

@Germanunkol
Copy link
Owner

Could you send me the script that fails to execute somehow?
I'd love to try it myself... because I gave the problem some more thought: It's also possible that there's something wrong with the encoding, which would be independent of the engine.

@BozoDel
Copy link
Contributor Author

BozoDel commented Jan 25, 2014

Oh, it's really simple, just have the AI script print anything with diacritics. "print ('á')" will do.

@Germanunkol
Copy link
Owner

Yes, but I thought it might depend on how you save the file (encoding). But I tried it, and it fails here, too. I also remember why, now: It's because special characters need more than one byte, I need to handle that seperately. I'll look into it soon, when I port the game.

@BozoDel
Copy link
Contributor Author

BozoDel commented Jan 26, 2014

It's funny because it's just the console. Diacritics are fine everywhere else.

@Germanunkol
Copy link
Owner

Yes, it's my word wrapping algorithm. It only takes into account single byte letters - but special characters can't be represented by plain ascii and are thus multiple characters long. I got this fixed in another project I was working on, and will try to port that fix here.

@hajo4
Copy link

hajo4 commented Feb 16, 2014

When you are looking at "print" and special chars:
is it possible to make a beep with "\a" ?

@BozoDel
Copy link
Contributor Author

BozoDel commented Feb 16, 2014

No, it doesn't beep. It prints a rectangle thingie. No error message though. What's "\a" supposed to be?

@hajo4
Copy link

hajo4 commented Feb 16, 2014

\a is control-char(7), aka "Alert" or "beep".

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

3 participants