Thing is, when I was using Dutch locale Windows and Linux, I never had any problems.
Now I can get the error by using 'fy_NL', which is installed on my system, but my guess is that the default locale in Lua is always 'C' anyway.
Possible problems with locales
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Possible problems with locales
Help us help you: attach a .love.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Possible problems with locales
It is not clearly defined it seems (it's an implementation detail), but since locales have the possibility of breaking the entire language, I would assume it is a 'normal' locale by default.
Re: Possible problems with locales
I think the locale of running processes is the default locale of the OS. Lua 5.1.4 doesn't change the locale so if processes do inherit the locale from the OS it's just a matter of finding someone with a weird locale to make the test script break.Robin wrote:<snip>, but my guess is that the default locale in Lua is always 'C' anyway.
For now I'll just add os.setlocale('C') to love.load but I think the best thing to do would be to have LÖVE both set the locale to C and remove setlocale from the os library.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Possible problems with locales
Even when I set the appropriate environment variables I can't get lua to use them.
Re: Possible problems with locales
Are you calling os.setlocale without arguments to see what the locale is when the script starts? And is the locale you're using a "weird" one?bartbes wrote:Even when I set the appropriate environment variables I can't get lua to use them.
This script
Code: Select all
print(os.setlocale())
print('---')
os.setlocale('fra_fra')
print(os.setlocale())
print(1.5)
print(tonumber('1.5'))
pcall(function () print('1.5' + 0) end)
print('---')
os.setlocale('C')
print(os.setlocale())
print(1.5)
print(tonumber('1.5'))
pcall(function () print('1.5' + 0) end)
Code: Select all
C
---
French_France.1252
1,5
nil
---
C
1.5
1.5
1.5
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Possible problems with locales
...
I pass environment variables, I am not calling os.setlocale, purposefully destroying your application is hardly a bug, is it?
I pass environment variables, I am not calling os.setlocale, purposefully destroying your application is hardly a bug, is it?
Re: Possible problems with locales
I think you might be onto something...bartbes wrote:purposefully destroying your application is hardly a bug, is it?
Re: Possible problems with locales
Sure it's not, I'm worried if the OS locale does cause problems when one forgets to explicitly set the locale to C which is still an open question to me.bartbes wrote:...
I pass environment variables, I am not calling os.setlocale, purposefully destroying your application is hardly a bug, is it?
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Possible problems with locales
As I said, I set the environment variables (as close as setting the OS locale as we're going to get), never set it in lua, and it uses c locale.
Re: Possible problems with locales
I'm just trying to make LÖVE more robust and make it a viable option for commercial games and for that I'd like to have these:vrld wrote:I think you might be onto something...bartbes wrote:purposefully destroying your application is hardly a bug, is it?
- Code obfuscation (probably solved with Squish.)
- Power of 2. I'd upload all textures with adjusted sizes to make them PO2 and create an option to disable this behavior in love.conf.
- Locale, though I'm not sure if it's a problem or not.
- I18n, though bartbes is taking care of it.
Who is online
Users browsing this forum: Ahrefs [Bot] and 2 guests