Hi,

I have a problem with insert form variables into an Oracle 8 db with my php : strings containing accents ('é', 'à'...) loose these accents !
I guess it's due to NLS_LANG environnement variable, its values is now "AMERICAN_AMERICA.WE8ISO8859P1".
But when I try to use
putenv("NLS_LANG=FRENCH_FRANCE.WE8ISO8859P1"); in my config included file, it doesn't seem to change anything?????
Does anybody knows the trick?
Thank you!

Nicolas

    Make sure that NLS_LANG has been set correctly on both the client and server sides.

    Are you using the "N" (national language) datatypes? For example: NCHAR, NVARCHAR2, and NCLOB.

    -- Michael
    Darkstreak - Computing & Innovations
    www.darkstreak.com

      But how and where do I set NLS_LANG to the proper value on my server and n my client?

      What do these field types change? Can I specify them a language????

      Thanks you !

        Talk with your Oracle DBA about NLS. He/She can help you figure out what needs to be done. There is a whole manual dedicated to just NLS support in Oracle.

        Terminology will get a little confusing below. From Oracle's perspective, things fall into one of two possibilities. Either you are talking about server-side components (the database and instance), or you are talking about client-side applications (PHP, your webserver, any Oracle Forms/Reports applications). This is true even if everything is on the same physical machine. Net8/SQL*Net is responsible for connecting the two worlds and resolving differences between them.

        Server-side:
        * For the database itself, the NLS parameters should be set in the INIT.ORA. The account which the database instance runs as should have the parameters set in the environment variables (both Unix and Windows) in its login script and the Registry (Windows). If you add/change these parameters, stop&restart the database.

        • The characterset may have been set when the database itself is created (CREATE DATABASE ... CHARACTERSET ...). Talk with your Oracle DBA about this.

        Client-side applications:
        For any account running client-side tools (examples: SQLPlus, PHP, Oracle Forms, etc.), that account should have the NLS parameters set in their login script. On Windows95/98/ME/NT/2K you should also set the parameter in Registry.

        • Make sure to do the above for the account running your PHP scripts. Usually this is the account which is also running Apache. So remember to set the environment variables in that account's login scripts. Depending on how you are running PHP under Apache, you may need to stop&restart Apache for changes to take effect.

        • Using putenv()in your PHP scripts. Again, depending on how you are using PHP under Apache, the Oracle client libraries may or may not see the effect of these putenv()s. But they are still a good idea.

        • All the above points still applies even if you are using IIS or some other webserver.

        It is too early to think further and I need to get to work. Good luck.

        -- Michael
        Darkstreak Computing & Innovations
        www.darkstreak.com

          Thanks to take so much time to answer me, I appreciate !
          I'll manage this with my dba admin.
          Good work!
          see you

            Write a Reply...