Where is the Conversion Done?
----------------------------

Take the typical example of a Windows client and a unix server:

OS characterset of the client: MSWIN1252
Characterset of the database: UTF8

Client NLS_LANG setting: AMERICAN_AMERICA.WE8MSWIN1252

You start sqlplus on the client, log onto the database and insert a row in a table.
At this time it's the CLIENT who converts the MSWIN1252 numeric values
into UTF8 numeric values for every character and sends the data over to the
database, the database then inserts the UTF8 data into the table.

The client has all lookup tables necessary to do the conversion and knows what
conversion is needed from the NLS_LANG parameter you set and the info
on the database characterset returned by the server.

If the database is using a characterset not known by the client
(you use an Oracle7 Client to a UTF8 Oracle8i database) then the conversion
is done at server side.


How can I Check the Client's NLS_LANG Setting?
---------------------------------------------

To be 100% sure about the value used by the client, you can use these methods
to get back the value of NLS_LANG:

On Unix:
-------

sql>host echo $NLS_LANG

This returns the value of the parameter.

On Windows:
-----------

On Windows NT you have two possible options, normally the NLS_LANG is set in
the registry, but it can also be set in the environment, however this is not
often done. The value in the environment takes precedence over the value in
the registry and is used for ALL Oracle_Homes on the server(!).

Please use the command line mode of sqlplus -> sqlplus.exe in a command prompt.

To check if it's set in the environment:

sql>host echo %NLS_LANG%

If this reports just %NLS_LANG% back, the variable is not set in the environment.

If it's set it reports something like
ENGLISH_UNITED KINGDOM.WE8ISO8859P1

If NLS_LANG is not set in the enviroment, check the value in the registry:

sql>@.[%NLS_LANG%].

If you get something like:
unable to open file ".[ENGLISH_UNITED KINGDOM.WE8ISO8859P1]."
the "file name" between the '[]' is the value of the registry parameter.

If you get this as result:
unable to open file ".[%NLS_LANG%]."
then the parameter NLS_LANG is also not set in the registry.

note: the @.[%NLS_LANG%]. "trick" reports the NLS_LANG known by the sqlplus
executable, it will not read the registry itself.
But then you are not shure if the variable is set in the enviroment or in the
registry. That's the reason of checking with the host commando first..

Defaults:
--------

If NLS_LANG is not set in the environment (and on Windows also not set
in the registry) then the parameter defaults to:

AMERICAN_AMERICA.US7ASCII

You can't see the value in a system view for your or another session,
you need to make an connection from the client and use the above methods to get the
information.