Oracle Apache PHP garbled problem __json

Source: Internet
Author: User

Approach One

SELECT * FROM V$nls_parameters

$conn = Oci_connect (' Scott ', ' Donkey ', ' demo ', ' ZHS16GBK ');

while ($dat = Oci_fetch_row ($cur)) {
Print_r (Iconv (' gb2312 ', ' utf-8 ', $dat [0])); $nickname = mb_convert_encoding ($dat [0], ' utf-8 ', ' GBK ');
}

or $c 1 = oci_connect ("Scott", "Tiger", $db, ' UTF8 ');

Option two:

After installing the server, look at the server language with the client

Sql>select * from V$nls_parameters Where parameter= ' nls_language ';

Like the result is "Simplified Chinese."

Add environment variables to Apache

Export nls_language= "Simplified Chinese"

Add in/etc/init.d/httpd, source code to install Apache write a script call Apachectl
Or you need to introduce the environment variable in/ETC/INIT.D/HTTPD, because the machine does not have the boot file, so you can only add the following code in APACHECTL:
Export nls_language= "Simplified Chinese".

Method Three: httpd.conf riga one row adddefaultcharset Gb2312/off
Method four: Htmlspecialchars () supports double-byte characters, such as Chinese characters
Htmlentities () supports Single-byte characters

Method Five: Apache configuration file has been added Adddefaultcharset GB2312
PHP's configuration file has been added Adddefaultcharset GB2312

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.