lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


marcus.cf wrote:
I tried the following and it worked on Linux. It didn't work on Windows probably because the C compiler didn't support locales the same way Linux did (don't remember if it was me who compiled my Windows version of Lua)

os.setlocale('pt_BR', 'numeric')
io.read('*n') -- accepts the number 5,6 and not 5.6

os.setlocale('C', 'numeric')
io.read('*n') -- back to '.'


On Windows :
os.setlocale('Portuguese - Brazil')
io.read('*n') -- accepts the number 5,6 and not 5.6

os.setlocale('English')
io.read('*n') -- back to '.'

--
Marcos