探讨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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

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

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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

Hot Topics

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Validator can be created by adding the following two lines in the controller.

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

Logging in CakePHP is a very easy task. You just have to use one function. You can log errors, exceptions, user activities, action taken by users, for any background process like cronjob. Logging data in CakePHP is easy. The log() function is provide
