ID: 39103
Updated by: [EMAIL PROTECTED]
Reported By: jhtpeter at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: OCI8 related
Operating System: Linux
PHP Version: 5.2.0RC5
-Assigned To:
+Assigned To: tony2001
Previous Comments:
------------------------------------------------------------------------
[2006-10-10 12:38:48] jhtpeter at gmail dot com
I'm sorry about this.
Description:
------------
I use oic(Oracle Instance Client) to call php-oci functions with php
5.2.x-dev.
The Oracle10g Database Server Charset is AL32UTF8.
The Web Env NLS_LANG is "SIMPLIFIED CHINESE_CHINA.ZHS16GBK".
When i get CLOB content, php return incorrect charset string, while
VARCHAR2 COLUMN is correct.
CREATE TABLE TEST (TITLE VARCHAR2(100) NULL, CONTENT CLOB NULL);
INSERT INTO TEST ('ÄãºÃ', 'ÕâÀïÊÇÄÚÈÝ');
COMMIT;
Reproduce code:
---------------
<?php
$conn = oci_connect('scott', 'tiger', '//localhost:1521/ORCL10G');
$stmt = oci_parse($conn, 'SELECT TITLE, CONTENT FROM TEST');
oci_execute($stmt, OCI_DEFAULT);
while ($row = oci_fetch_array($stmt,
(OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS))) {
echo 'VARCHAR2_TITLE: ' . $row['TITLE'] . '<br>';
echo 'CLOB_CONTENT: ' . $row['CONTENT'] . '<br>';
}
?>
Expected result:
----------------
VARCHAR2_TITLE: ÄãºÃ
CLOB_CONTENT: ÕâÀïÊÇÄÚÈÝ
Actual result:
--------------
VARCHAR2_TITLE: ÄãºÃ (correct)
CLOB_CONTENT: ????? (incorrect)
------------------------------------------------------------------------
[2006-10-10 08:52:51] [EMAIL PROTECTED]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2006-10-10 02:18:46] jhtpeter at gmail dot com
Description:
------------
I use oic(Oracle Instance Client) to call php-oci functions with php
5.2.x-dev.
The Oracle10g Database Server Charset is AL32UTF8.
The Web Env NLS_LANG is "SIMPLIFIED CHINESE_CHINA.ZHS16GBK".
When i get CLOB use oci_fetch_array with options OCI_RETURN_LOBS, php
return incorrect charset.
While VARCHAR2 COLUMN is correct.
The same to oci_fetch_all.
Reproduce code:
---------------
$sql = "SELECT VARCHAR2_TITLE, CLOB_CONTENT FROM TEST";
oci_prase...
oci_fetch_array...
Expected result:
----------------
VARCHAR2_TITLE:
±êÌâ(correct charset in ZHS16GBK)
CLOB_CONTENT:
ÄÚÈÝ(correct charset in ZHS16GBK)
Actual result:
--------------
VARCHAR2_TITLE:
±êÌâ(correct charset in ZHS16GBK)
CLOB_CONTENT:
£¿£¿£¿£¿(incorrect charset in AL32UTF8)
------------------------------------------------------------------------
[2006-10-10 02:11:36] jhtpeter at gmail dot com
Description:
------------
I use oic(Oracle Instance Client) to call php-oci functions with php
5.2.x-dev.
The Oracle10g Database Server Charset is AL32UTF8.
The Web Env NLS_LANG is "SIMPLIFIED CHINESE_CHINA.ZHS16GBK".
When i get CLOB use oci_fetch_array with options OCI_RETURN_LOBS, php
return incorrect charset.
While VARCHAR2 COLUMN is correct.
The same to oci_fetch_all.
Reproduce code:
---------------
$sql = "SELECT VARCHAR2_TITLE, CLOB_CONTENT FROM TEST";
oci_prase...
oci_fetch_array...
Expected result:
----------------
VARCHAR2_TITLE:
±êÌâ(correct charset in ZHS16GBK)
CLOB_CONTENT:
ÄÚÈÝ(correct charset in ZHS16GBK)
Actual result:
--------------
VARCHAR2_TITLE:
±êÌâ(correct charset in ZHS16GBK)
CLOB_CONTENT:
ÄÚÈÝ(incorrect charset in AL32UTF8)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39103&edit=1