环境:
oracle数据库是安装在xp上。
版本:10.2.0.3
nls_language
american
nls_territory
america
nls_characterset
zhs16gbk
一、sqlplus客户端操作数据库(客户端操作语言环境为simplified chinese_china.zhs16gbk):
1、
cmd
set nls_lang=american_america.zhs16gbk
sqlplus /nolog
conn scott/tiger@salesnew
insert into emp values('7777','你','好','7709','1-11月-2012','5000','800','20');
commit;
select * from emp;
empno ename job mgr hiredate sal comm
---------- ---------- --------- ---------- ------------ ---------- ----------
deptno
----------
7777 你 好 7709 01-nov-12 5000 800
20
结论:我录入的数据库是没有问题的。
二、php通过oci操作oracle
1、php所以操作及环境为windows 2003 x86 企业版简体中文+iis6.0+oracle instantclient-basic-win32-10.2.0.4.zip+fcgisetup_1.5_rtw_x86.msi
2、配置完所有必需的环境后,测试了
显示一切正常
3、开始操作oracle
中文部分乱码
如下所示:
10.2.0.4.0oracle database 10g enterprise edition release 10.2.0.3.0 - production with the partitioning, olap and data mining options
7777 äã ºã 7709 01-nov-12 5000 800 20
8888 öó º£ 7709 01-nov-10 5000 800 20
9999 àî ¾ê 8888 01-jan-11 3000 5000 20
7369 smith clerk 7902 17-dec-80 800 20
7499 allen salesman 7698 20-feb-81 1600 300 30
7521 ward salesman 7698 22-feb-81 1250 500 30
7566 jones manager 7839 02-apr-81 2975 20
7654 martin salesman 7698 28-sep-81 1250 1400 30
7698 blake manager 7839 01-may-81 2850 30
7782 clark manager 7839 09-jun-81 2450 10
7788 scott analyst 7566 19-apr-87 3000 20
7839 king president 17-nov-81 5000 10
7844 turner salesman 7698 08-sep-81 1500 0 30
7876 adams clerk 7788 23-may-87 1100 20
7900 james clerk 7698 03-dec-81 950 30
7902 ford analyst 7566 03-dec-81 3000 20
7934 miller clerk 7782 23-jan-82 1300 10
测试页面本身中文显示情况
这一个问题已经折腾我快疯了,百度、谷歌了好几天都解决不了这个问题。
尝试过以下方法
1、设置php环境所在的操作系统环境变量nls_lagn=simplified chinese_china.zhs16gbk或nls_lang=american_america.zhs16gbk。
