探讨PHP获取Oracle数据乱码的相关问题解决办法
出的问题是:
不管转码不转码,页面上从oracle获取的中文始终显示为“?”,即一个个的问号。
解决问题:
从mysql查询的角度出发,我觉得是少了set names ***,但问了DBA,oracle没有相关的命令行,所以排出这个问题;
又把问题的集中点放在转码上,折腾半小时,把程序里各个地方都加了测试参数,发现根源上的数据就有问题,不在转码上,于是写了单独一个php的oracle的查询页用来测试,结果如我所想还是乱码,所以立刻排出页面的问题;
最后在google的帮助下找到一篇问章,说是需要在init.d下的httpd里引入环境变量,由于本机没有那个启动文件,所以只能在apachectl里加入如下代码:
<ol class="dp-xml"><li class="alt"><span><span>export </span><span class="attribute">NLS_LANGUAGE</span><span>=”SIMPLIFIED CHINESE” </span></span></li></ol>
重启apache服务,问题解决!!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Notepad++7.3.1
Easy-to-use and free code editor

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Mac version
God-level code editing software (SublimeText3)

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
