Where to setlocale(3)?

php.internals

Michael B Allen

19 years ago
How does one PROPERLY set the locale under which PHP scripts run? Is it a script level property, PHP level property, HTTP level property or inherited from the OS default? I have a module that converts strings between the locale character encoding and another encoding. Currently setlocale(LC_CTYPE, NULL) within a script returns 'C' which is to say the locale is not set. Where do I look? Thanks, Mike
-- Michael B Allen PHP Active Directory SSO http://www.ioplex.com/

Jochem Maas

19 years ago
Michael B Allen wrote:
> How does one PROPERLY set the locale under which PHP scripts run? Is > it a script level property,
if you want. PHP level property, yes. HTTP level property or dont know
> inherited from the OS default?
the default is inherited from the OS unless something is broken.
> > I have a module that converts strings between the locale character > encoding and another encoding. Currently setlocale(LC_CTYPE, NULL) > within a script returns 'C' which is to say the locale is not set.
'C' = Posix std locale.
> > Where do I look?
what do you want to find? ;-)

Ilia A.

19 years ago
You just call the setlocale() function in PHP. On 6-Nov-06, at 10:18 PM, Michael B Allen wrote:
> How does one PROPERLY set the locale under which PHP scripts run? Is > it a script level property, PHP level property, HTTP level property or > inherited from the OS default? > > I have a module that converts strings between the locale character > encoding and another encoding. Currently setlocale(LC_CTYPE, NULL) > within a script returns 'C' which is to say the locale is not set. > > Where do I look? > > Thanks, > Mike > > -- > Michael B Allen > PHP Active Directory SSO > http://www.ioplex.com/ > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >
Ilia Alshanetsky