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

Problems with the Windows version of XAMPP, questions, comments, and anything related.

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

Postby beppejo » 06. September 2013 11:00

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.
beppejo
 
Posts: 3
Joined: 06. September 2013 10:44
XAMPP Version: 1.8.3-2
Operating System: Windows 7

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

Postby Altrea » 06. September 2013 21:01

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.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6946
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: Windows 10 Pro x64

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

Postby beppejo » 16. September 2013 10:20

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.
beppejo
 
Posts: 3
Joined: 06. September 2013 10:44
XAMPP Version: 1.8.3-2
Operating System: Windows 7

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

Postby Altrea » 16. September 2013 12:56

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);
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6946
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: Windows 10 Pro x64

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

Postby beppejo » 17. September 2013 08:21

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.
beppejo
 
Posts: 3
Joined: 06. September 2013 10:44
XAMPP Version: 1.8.3-2
Operating System: Windows 7

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

Postby Altrea » 17. September 2013 14:54

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.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6946
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: Windows 10 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 31 guests