# Where to setlocale(3)?

- Thread: https://externals.io/message/26393
- Original archive: https://news-web.php.net/php.internals/26393
- Started by Michael B Allen on 2006-11-07T03:18:05+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #26393 — Michael B Allen — 2006-11-07T03:18:05+00:00

URL: https://externals.io/message/26393#26393

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/

---

## #26396 — Jochem Maas — 2006-11-07T08:34:07+00:00

URL: https://externals.io/message/26393#26396 · In reply to: #26393

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? ;-)

> 
> Thanks,
> Mike

---

## #26408 — Ilia Alshanetsky — 2006-11-07T16:39:08+00:00

URL: https://externals.io/message/26393#26408 · In reply to: #26393

You just call the `setlocale()` function in PHP.




> 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/
>
> -- 
> 
> 
>
>

Ilia Alshanetsky
