Re: Oracle 10g / PHP / utf-8

From: <sybrandb_at_hccnet.nl>
Date: Thu, 20 Nov 2008 00:09:06 +0100
Message-ID: <cp69i49h9akqd9no71q07kenjur5peuj3t@4ax.com>


Comments embedded

On Wed, 19 Nov 2008 10:18:37 -0800 (PST), Nico <nicodenboer_at_yahoo.com> wrote:

>Hi, I have installed the Oracle Database 10g Express Edition Release
>10.2.0.1.0 on a Linux workstation for dev purposes, along with Apache
>2 and PHP5. The production environment uses Unix for the Oracle
>database server, Win2003/IIS for the webserver.
>
>Our PHP application works with UTF-8 encoded strings and actually
>sends SQL INSERTS in UTF-8 format to the server.
the server. Which one? The server hosting Express Edition, or the server using an unknown version of Oracle RDBMS whatever? Is Apache involved or IIS?

 When this data is
>retrieved, foreign characters (all characters which are not in the
>Basic Latin alphabet) are corrupted. It's not clear to me where I
>should search for the characterset related issues.
You need to read the Globalization Manual. It seems to be a
>server-side problem.

Why? Assuming the database characterset is an UTF8 one, why would it be a server side problem? Did you check the NLS_LANG environment variable (Unixes) or the NLS_LANG string variable in the registry on the IIS server?

>
>Some NLS settings:
>

There are NLS session, instance and database parameters. To which one does this refer?
>National Language Parameter Value
>NLS_CHARACTERSET AL32UTF8
>NLS_COMP BINARY
>NLS_LANGUAGE AMERICAN
>NLS_NCHAR_CHARACTERSET AL16UTF16
>NLS_NCHAR_CONV_EXCP FALSE
>NLS_TERRITORY AMERICA
>
>Questions:
>- Is it possible to use ALTER SESSION to change the characterset?
No, it isn't
>- What do we need to configure in order to have the database server
>and the client work with UTF-8?
>

You need to set up NLS_LANG on the client side (client can be a webserver appropiately). Which is in the documentation you didn't read.
>Thanks in advance for your reply.
>
>Kind regards,
>Nico

Regards,

-- 
Sybrand Bakker
Senior Oracle DBA
Received on Wed Nov 19 2008 - 17:09:06 CST

Original text of this message