472,110 Members | 2,096 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,110 software developers and data experts.

problem with "setlocale"

Hi Everybody

Why the following script return NULL?

this is the following:
<?php

var_dump ( setlocale(LC_ALL, "pl") );

?>

this is the return:

bool(false)

I use:
1. apache2
2. Ubuntu 6.06 LTS - Dapper Drake

When I execute 'locale' in my terminal I return the following
messages:

rob$ locale
LANG=pl_PL.UTF-8
LANGUAGE=pl_PL:pl:en_GB:en
LC_CTYPE="pl_PL.UTF-8"
LC_NUMERIC="pl_PL.UTF-8"
LC_TIME="pl_PL.UTF-8"
LC_COLLATE="pl_PL.UTF-8"
LC_MONETARY="pl_PL.UTF-8"
LC_MESSAGES="pl_PL.UTF-8"
LC_PAPER="pl_PL.UTF-8"
LC_NAME="pl_PL.UTF-8"
LC_ADDRESS="pl_PL.UTF-8"
LC_TELEPHONE="pl_PL.UTF-8"
LC_MEASUREMENT="pl_PL.UTF-8"
LC_IDENTIFICATION="pl_PL.UTF-8"
LC_ALL=

rob$locale -a | grep PL
pl_PL.utf8

Any suggestion or comments is greatly appreciated.
Robert.

Jul 7 '07 #1
3 5107
On Jul 7, 10:48 am, robert.szczepan...@gmail.com wrote:
Hi Everybody

Why the following script return NULL?

this is the following:
<?php

var_dump ( setlocale(LC_ALL, "pl") );

?>

this is the return:

bool(false)

I use:
1. apache2
2. Ubuntu 6.06 LTS - Dapper Drake

When I execute 'locale' in my terminal I return the following
messages:

rob$ locale
LANG=pl_PL.UTF-8
LANGUAGE=pl_PL:pl:en_GB:en
LC_CTYPE="pl_PL.UTF-8"
LC_NUMERIC="pl_PL.UTF-8"
LC_TIME="pl_PL.UTF-8"
LC_COLLATE="pl_PL.UTF-8"
LC_MONETARY="pl_PL.UTF-8"
LC_MESSAGES="pl_PL.UTF-8"
LC_PAPER="pl_PL.UTF-8"
LC_NAME="pl_PL.UTF-8"
LC_ADDRESS="pl_PL.UTF-8"
LC_TELEPHONE="pl_PL.UTF-8"
LC_MEASUREMENT="pl_PL.UTF-8"
LC_IDENTIFICATION="pl_PL.UTF-8"
LC_ALL=

rob$locale -a | grep PL
pl_PL.utf8

Any suggestion or comments is greatly appreciated.
Robert.
You're trying to set the locale to "pl" which doesn't exist on your
system (as you've shown us). Try setting it to "pl_PL.utf8" instead.

Jul 7 '07 #2
Try using 'pl_PL.utf8' as the locale id.

On Jul 7, 10:48 am, robert.szczepan...@gmail.com wrote:
Hi Everybody

Why the following script return NULL?

this is the following:
<?php

var_dump ( setlocale(LC_ALL, "pl") );

?>

this is the return:

bool(false)

I use:
1. apache2
2. Ubuntu 6.06 LTS - Dapper Drake

When I execute 'locale' in my terminal I return the following
messages:

rob$ locale
LANG=pl_PL.UTF-8
LANGUAGE=pl_PL:pl:en_GB:en
LC_CTYPE="pl_PL.UTF-8"
LC_NUMERIC="pl_PL.UTF-8"
LC_TIME="pl_PL.UTF-8"
LC_COLLATE="pl_PL.UTF-8"
LC_MONETARY="pl_PL.UTF-8"
LC_MESSAGES="pl_PL.UTF-8"
LC_PAPER="pl_PL.UTF-8"
LC_NAME="pl_PL.UTF-8"
LC_ADDRESS="pl_PL.UTF-8"
LC_TELEPHONE="pl_PL.UTF-8"
LC_MEASUREMENT="pl_PL.UTF-8"
LC_IDENTIFICATION="pl_PL.UTF-8"
LC_ALL=

rob$locale -a | grep PL
pl_PL.utf8

Any suggestion or comments is greatly appreciated.
Robert.

Jul 7 '07 #3
Thenk You for help!

Robert.

Jul 8 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.