problem with "setlocale"

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • robert.szczepanski@gmail.com

    problem with "setlocale"

    Hi Everybody

    Why the following script return NULL?

    this is the following:
    <?php

    var_dump ( setlocale(LC_AL L, "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="p l_PL.UTF-8"
    LC_MEASUREMENT= "pl_PL.UTF-8"
    LC_IDENTIFICATI ON="pl_PL.UTF-8"
    LC_ALL=

    rob$locale -a | grep PL
    pl_PL.utf8

    Any suggestion or comments is greatly appreciated.
    Robert.

  • ZeldorBlat

    #2
    Re: problem with &quot;setlocale &quot;

    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_AL L, "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="p l_PL.UTF-8"
    LC_MEASUREMENT= "pl_PL.UTF-8"
    LC_IDENTIFICATI ON="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.

    Comment

    • petersprc

      #3
      Re: problem with &quot;setlocale &quot;

      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_AL L, "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="p l_PL.UTF-8"
      LC_MEASUREMENT= "pl_PL.UTF-8"
      LC_IDENTIFICATI ON="pl_PL.UTF-8"
      LC_ALL=
      >
      rob$locale -a | grep PL
      pl_PL.utf8
      >
      Any suggestion or comments is greatly appreciated.
      Robert.

      Comment

      • robert.szczepanski@gmail.com

        #4
        Re: problem with &quot;setlocale &quot;

        Thenk You for help!

        Robert.

        Comment

        Working...