Re: Oracle 10g / PHP / utf-8
Date: 20 Nov 2008 10:09:25 GMT
Message-ID: <1227175763.29455@proxy.dienste.wien.at>
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. 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. It seems to be a
> server-side problem.
>
> Some NLS settings:
>
> 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?
> - What do we need to configure in order to have the database server
> and the client work with UTF-8?
You'll have to set the environment variable NLS_LANG to
AMERICAN_AMERICA.AL32UTF8
so that the Oracle client knows that the data you feed it is actually UTF-8.
Yours,
Laurenz Albe
Received on Thu Nov 20 2008 - 04:09:25 CST