ID: 17381
Updated by: [EMAIL PROTECTED]
Reported By: robert dot earls at lsi dot co dot uk
-Status: Assigned
+Status: Bogus
Bug Type: OCI8 related
Operating System: Win NT
PHP Version: 4.2.1
Assigned To: maxim
New Comment:
Too old version (we're at 4.3.3 now) and also, the environment
variables HAVE to be set in the shell, NOT in the script.
They won't work otherwise.
Previous Comments:
------------------------------------------------------------------------
[2002-05-23 06:50:05] robert dot earls at lis dot co dot uk
Can I just point out that I have used putenv, to set NLS_LANG in the
example, because I thought that the system-wide environment variable
$NLS_LANG was not being picked up. It is currently set to
"American_America.UTF8".
------------------------------------------------------------------------
[2002-05-23 05:32:37] robert dot earls at lsi dot co dot uk
I seem to be unable to return un-corrupted data from a UTF8 Oracle
database.
Consider this example:- (appologies for debugging)
<?
putenv("NLS_LANG=American_America.UTF8");
mb_internal_encoding("UTF-8");
$sql = "select dump(mycolumn) dump, mycolumn from my_table";
$link = OCIplogon("user","pass","connection");
//OCIInternalDebug(1);
$parse = OCIParse($link,$sql);
OCIExecute($parse);
if (OCIFetch($parse))
{
$mycolumn = OCIResult($parse, "mycolumn");
$mycolumndump = OCIResult($parse, "DUMP");
print "found:";
print bin2hex($mycolumn);
print ": ".$mycolumn." : len = ".mb_strlen($mycolumn);
print "<br><br>";
print $mycolumndump;
print "<br><br>";
print mb_detect_encoding($mycolumn, "auto");
print "<br><br>";
print mb_internal_encoding();
print "<br><br>";
print_r( mb_get_info("all"));
}
?>
e.g.
If mycolumn contains a single UTF8 character E594B4 (three bytes)
I get the result:-
found:bf {upsidedown question mark} len=1
Typ=1 Len=3 228,148,180
EUC-JP
UTF-8
-
I would have expected to see:
found:e594b4 {a japanese glyph} len=3
I suppose the question is, does the OCI interface work correctly with
multi-byte strings?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17381&edit=1