Page 1 of 1

italian location with PHP function setlocale()+localeconv()

PostPosted: 06. September 2013 11:00
by beppejo
With XAMPP version 1.8.2-1 and 1.8.2-2 when I setlocale(LC_ALL ...) for Italy, than when I call the localeconv() for having the setting, all the value are like empty. I don't try with 1.8.3.
Version 1.8.1 with the same code works properly.
The settings are used after in the code for localized version of number and dates.
Good work, thank you for all, Giuseppe.

italian location with PHP function setlocale()+localeconv()

PostPosted: 06. September 2013 21:01
by Altrea
Hi Giuseppe,

I don't understand why people don't post their relating code for their problem.

Obviously you have not used the correct setting for LC_ALL.

The following is working for me:
Code: Select all
setlocale(LC_ALL, "it_IT.UTF-8",'it_IT@euro',"ita");


best wishes,
Altrea

P.S.: not a bug, sorry.

Re: italian location with PHP function setlocale()+localecon

PostPosted: 16. September 2013 10:20
by beppejo
Hi, I don't post the code because it's too much complex, It's works on different level functions.
I use correct setting for LC_ALL and test return code for setlocale(). I use codes constructed from user browser.
The test that the codes is right is that now I use again version 1.8.1 without problems. The problems aren't on setlocale(), but if you after call localeconv(), you can see that the values returned aren't correct. The strange thing is that if I try multiple times, sometimes localeconv() is right.
Hello, Giuseppe.

Re: italian location with PHP function setlocale()+localecon

PostPosted: 16. September 2013 12:56
by Altrea
What is the result of this
Code: Select all
<?php
$loc = setlocale(LC_ALL, "it_IT.UTF-8",'it_IT@euro',"ita");
var_dump($loc);

Re: italian location with PHP function setlocale()+localecon

PostPosted: 17. September 2013 08:21
by beppejo
Hello. I don't say that.
I saied that I tested setlocale() for return not false and without warning.
And than if you write "$values = localeconv();"
The values into the array "$values" aren't correct, with 1.8.2, but are ok with 1.8.1.

Re: italian location with PHP function setlocale()+localecon

PostPosted: 17. September 2013 14:54
by Altrea
The localeconv() values are strictly dependend on the setted locale so this output is very important if you get the wrong values.
But you don't tell us which values you get and which values you expect so at this point noone here will be able to provide any support for you.