jeudi 9 avril 2015

PHP setlocale exist but is Wrong

I'm trying to set the pt_BR locale in my application.


But, for some reason, my number format configuration is still in the wrong format.


I tried to set the correct locale in so many ways:



setlocale(LC_ALL, 'pt_BR');
setlocale(LC_ALL, 'pt_BR.utf-8', 'pt_BR', 'portuguese', 'pt-br');
setlocale(LC_ALL, 'pt_BR.utf-8');
setlocale(LC_ALL, 'portuguese');


But, for all of them, I have the decimal_point with a dot. The correct value for this, in portuguese, is a comma. It's all the same result:



array (size=18)
'decimal_point' => string '.' (length=1)
'thousands_sep' => string '' (length=0)
'int_curr_symbol' => string '' (length=0)
'currency_symbol' => string '' (length=0)
'mon_decimal_point' => string '' (length=0)
'mon_thousands_sep' => string '' (length=0)
'positive_sign' => string '' (length=0)
'negative_sign' => string '' (length=0)
'int_frac_digits' => int 127
'frac_digits' => int 127
'p_cs_precedes' => int 127
'p_sep_by_space' => int 127
'n_cs_precedes' => int 127
'n_sep_by_space' => int 127
'p_sign_posn' => int 127
'n_sign_posn' => int 127
'grouping' =>
array (size=0)
empty
'mon_grouping' =>
array (size=0)
empty


This happens in my local environment and some other Windows computers that I tested. But in some another Windows it works. All computers running Windows 7. I also tested in a UNIX environment and works well. The problem is just for some Windows installations.


The locale exist but is wrong for some reason.


Someone has an idea to help me? I'd like to understand why this is happening.


Thanks


Aucun commentaire:

Enregistrer un commentaire