Hi all!!
This problem has been driving me nuts these past weeks and I just can't get it solved. I'm not very much familiar with Linux/Unix OS and that might be getting in the way of sorting this thing out.
Here's what's happening. I run applications with languages on ISO-8859-1 (latin). It's an old 9i DB that's been up for at least 8 years. I think it started as v8 and then was upgraded to 9i, but I'm not the DBA, so I'm not sure. What I'm sure is that this DB was created using latin language patterns, and that several applications are currently running fine based on that DB.
So I developed my own PHP web site and hosted it in a shared CentOS4 server which is in en_US. That's when my problems started.
Now every query run through PHP pages returns ? replacing latin characters. That doesn't happen on my testing environment, which is Windows in Brazilian Portuguese (latin language), nor on TOAD. I've run several tests to make sure it's not an Apache or PHP issue, or even HTML headers. Those are all fine. It's a sure thing that the queries are being returned with replaced characters.
Now, here's some info:
OS: CentOS4
Server: Apache 1 stable
Parser: PHP 4 stable
DB: Oracle 9i
Client: 10g v_10.1.3 (not instant client)
Client Install Folder: /u01/app/oracle
HTML Headers:
HTML Code:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
File httpd.conf settings (Apache Config):
AddLanguage pt .pt
AddLanguage pt-BR .pt-br
LanguagePriority pt-BR en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt ru sv zh-CN zh-TW
ForceLanguagePriority Prefer Fallback
AddDefaultCharset ISO-8859-1
AddCharset ISO-8859-1 .iso8859-1 .latin1
AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
On CentOS, if I run the command locale, that's the output (US English):
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
The output of the command locale -a shows a whole lot of languages, inclusive (these are Brazilian Portuguese and Portugal Portuguese):
pt_BR
pt_BR.iso88591
pt_BR.utf8
pt_PT
pt_PT@euro
pt_PT.iso88591
pt_PT.iso885915@euro
pt_PT.utf8
I've read elsewhere that the Oracle Client will prioritize the OS language settings when returning queries. I don't know if there's any truth in that, but if so, is it possible to override that?
Also some people have told me I might have to edit the NLS_LANG settings in the Oracle Client profile to
NLS_LANG=BRAZILIAN PORTUGUESE_BRAZIL.WE8ISO8859P1
but nobody has been able to tell me where that profile is located, so I don't even know what's it's set to, if anything.
That's all the info I've got.
Any help will be extremely appreciated.