NLS_LANG client problem

NLS_LANG client problem

Post by Fernando Dona » Wed, 24 Jul 2002 20:21:07



Hello list

I have installed oracle client 9.0.1 in my Linux box.
my ~oracle/.bash_profile:

umask 022
if [ -f ~/.bashrc ]; then
    source ~/.bashrc
fi

ORACLE_BASE=/usr/local/oracle
export ORACLE_BASE
ORA_NLS33=/usr/local/oracle/product/9.0.1/ocommon/nls/admin/data
export ORA_NLS33
NLS_LANG=SPANISH_SPAIN.WE8ISO8859P1
export NLS_LANG

But when I insert data in the oracle DB server , from a form web (php)
that contains the '?','','','','' and '' characteres, they don't
appear well in the Server

Is anything missing?
Any missconfiguration?

Thanks.
Fernando

 
 
 

NLS_LANG client problem

Post by Anura » Wed, 24 Jul 2002 21:12:49


I don't know php ... but you should understand that:
* Setting NLS_LANG for oracle user will set it for only that user.
* Thus you need to make sure that the web user has this same envioronment variable set.

Anurag


Quote:> Hello list

> I have installed oracle client 9.0.1 in my Linux box.
> my ~oracle/.bash_profile:

> umask 022
> if [ -f ~/.bashrc ]; then
>     source ~/.bashrc
> fi

> ORACLE_BASE=/usr/local/oracle
> export ORACLE_BASE
> ORA_NLS33=/usr/local/oracle/product/9.0.1/ocommon/nls/admin/data
> export ORA_NLS33
> NLS_LANG=SPANISH_SPAIN.WE8ISO8859P1
> export NLS_LANG

> But when I insert data in the oracle DB server , from a form web (php)
> that contains the '?','','','','' and '' characteres, they don't
> appear well in the Server

> Is anything missing?
> Any missconfiguration?

> Thanks.
> Fernando


 
 
 

NLS_LANG client problem

Post by Fernando Dona » Thu, 25 Jul 2002 17:42:00


The WEb (Apache) User and the oracle user has the same environment
variables. With both users, from sqlplus, I can insert and get words
with ,,etc, but not from a php web page.

Any idea?
Thanks


> I don't know php ... but you should understand that:
> * Setting NLS_LANG for oracle user will set it for only that user.
> * Thus you need to make sure that the web user has this same envioronment variable set.

> Anurag



> > Hello list

> > I have installed oracle client 9.0.1 in my Linux box.
> > my ~oracle/.bash_profile:

> > umask 022
> > if [ -f ~/.bashrc ]; then
> >     source ~/.bashrc
> > fi

> > ORACLE_BASE=/usr/local/oracle
> > export ORACLE_BASE
> > ORA_NLS33=/usr/local/oracle/product/9.0.1/ocommon/nls/admin/data
> > export ORA_NLS33
> > NLS_LANG=SPANISH_SPAIN.WE8ISO8859P1
> > export NLS_LANG

> > But when I insert data in the oracle DB server , from a form web (php)
> > that contains the '?','','','','' and '' characteres, they don't
> > appear well in the Server

> > Is anything missing?
> > Any missconfiguration?

> > Thanks.
> > Fernando

 
 
 

NLS_LANG client problem

Post by Anura » Thu, 25 Jul 2002 21:07:03


Fernando,

Due to my inexperience with php, I can only guess.

I assumed that php db interface works like perl.
Perl uses a Interface called DBI + DBD:Oracle which itself (AFAIK)
uses the Oracle OCI library. Also, it uses the NLS_LANG variable
to determine what Language/character setting the client is using.
Java thin driver however does not use the NLS_LANG setting ....
AFAIK, it talks to the server and assumes that character setting.

Thus, you need to take into account two things:
* Determine what characterset the data being input is in. If I have a
   UTF8 data which I try to insert in perl using a WE8ISO..
   NLS_LANG setting, I might see garbled data being inserted.
* Determine how the php interface is inserting data .. i.e. does it
   use the NLS_LANG?

To me it appears that either your data is not in WE8I... charset ...
or ... if php uses NLS_LANG .. the env variable is not set (which you
said was not the case .. i.e. it is set)

Also, What is the characterset of your database? WE8I.. or UTF8 .. or ...?
Maybe some php guru can comment on this?

Anurag


> The WEb (Apache) User and the oracle user has the same environment
> variables. With both users, from sqlplus, I can insert and get words
> with ,,etc, but not from a php web page.

> Any idea?
> Thanks


> > I don't know php ... but you should understand that:
> > * Setting NLS_LANG for oracle user will set it for only that user.
> > * Thus you need to make sure that the web user has this same envioronment variable set.

> > Anurag



> > > Hello list

> > > I have installed oracle client 9.0.1 in my Linux box.
> > > my ~oracle/.bash_profile:

> > > umask 022
> > > if [ -f ~/.bashrc ]; then
> > >     source ~/.bashrc
> > > fi

> > > ORACLE_BASE=/usr/local/oracle
> > > export ORACLE_BASE
> > > ORA_NLS33=/usr/local/oracle/product/9.0.1/ocommon/nls/admin/data
> > > export ORA_NLS33
> > > NLS_LANG=SPANISH_SPAIN.WE8ISO8859P1
> > > export NLS_LANG

> > > But when I insert data in the oracle DB server , from a form web (php)
> > > that contains the '?','','','','' and '' characteres, they don't
> > > appear well in the Server

> > > Is anything missing?
> > > Any missconfiguration?

> > > Thanks.
> > > Fernando

 
 
 

NLS_LANG client problem

Post by Fernando Dona » Sat, 27 Jul 2002 01:17:57


Hello

I did it!!! I can sleep now!

I've had to put the NLS_LANG,ORA_NLS33,etc.. environment variables in
the /etc/profile file so the Apache (Web) user gets this values.
Before, I had got this values in the ~/.bash_profile file but didn't
go ok ????

The php settings says that data is in we8ISO format so the problem was
the environment set.

Thanks Anurag!
Bye!


> Fernando,

> Due to my inexperience with php, I can only guess.

> I assumed that php db interface works like perl.
> Perl uses a Interface called DBI + DBD:Oracle which itself (AFAIK)
> uses the Oracle OCI library. Also, it uses the NLS_LANG variable
> to determine what Language/character setting the client is using.
> Java thin driver however does not use the NLS_LANG setting ....
> AFAIK, it talks to the server and assumes that character setting.

> Thus, you need to take into account two things:
> * Determine what characterset the data being input is in. If I have a
>    UTF8 data which I try to insert in perl using a WE8ISO..
>    NLS_LANG setting, I might see garbled data being inserted.
> * Determine how the php interface is inserting data .. i.e. does it
>    use the NLS_LANG?

> To me it appears that either your data is not in WE8I... charset ...
> or ... if php uses NLS_LANG .. the env variable is not set (which you
> said was not the case .. i.e. it is set)

> Also, What is the characterset of your database? WE8I.. or UTF8 .. or ...?
> Maybe some php guru can comment on this?

> Anurag



> > The WEb (Apache) User and the oracle user has the same environment
> > variables. With both users, from sqlplus, I can insert and get words
> > with ,,etc, but not from a php web page.

> > Any idea?
> > Thanks


> > > I don't know php ... but you should understand that:
> > > * Setting NLS_LANG for oracle user will set it for only that user.
> > > * Thus you need to make sure that the web user has this same envioronment variable set.

> > > Anurag



> > > > Hello list

> > > > I have installed oracle client 9.0.1 in my Linux box.
> > > > my ~oracle/.bash_profile:

> > > > umask 022
> > > > if [ -f ~/.bashrc ]; then
> > > >     source ~/.bashrc
> > > > fi

> > > > ORACLE_BASE=/usr/local/oracle
> > > > export ORACLE_BASE
> > > > ORA_NLS33=/usr/local/oracle/product/9.0.1/ocommon/nls/admin/data
> > > > export ORA_NLS33
> > > > NLS_LANG=SPANISH_SPAIN.WE8ISO8859P1
> > > > export NLS_LANG

> > > > But when I insert data in the oracle DB server , from a form web (php)
> > > > that contains the '?','','','','' and '' characteres, they don't
> > > > appear well in the Server

> > > > Is anything missing?
> > > > Any missconfiguration?

> > > > Thanks.
> > > > Fernando

 
 
 

1. Problem with NLS_LANG: Clients versus database

        Here's the situation.
        We have a database with NLS_LANG defined as USA...
        The clients share a common definition file with NLS_LANG
        defined as FRENCH... And some of the clients access only
        FRENCH... databases. So I can't modify the common definition
        file.
        And I know I can recreate the database.

        But is there a way to change the NLS_LANG at another level ??

        Thanks for the reply.

                CIAO Pierre

2. Backups and Incoming Data

3. nls_lang registry-key in NT different client/server

4. Visual C++ method to retrieve table names?

5. 2 nls_lang settings on 1 client

6. Data Junction

7. Problem with Reports when NLS_LANG set

8. Multiprocessor deadlock

9. NLS_LANG problems

10. Client limitation problem using Access 2000 as client

11. Quirky performance differences/problems between connections made by Unix client versus Windows Client

12. Problem adding clients in Client configuration Manager dev2k 2.0