#28117 [Fbk-Csd]: chinese comparision in delphi 5 COM object

2005-01-25 Thread kaija_jan at hotmail dot com
 ID:   28117
 User updated by:  kaija_jan at hotmail dot com
 Reported By:  kaija_jan at hotmail dot com
-Status:   Feedback
+Status:   Closed
 Bug Type: COM related
 Operating System: windows 2k
 PHP Version:  5.0.0RC1
 New Comment:

thx for reply


Previous Comments:


[2005-01-26 04:53:34] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip





[2004-04-28 09:38:55] kaija_jan at hotmail dot com

iis 5 and apache 2
if you need hex output in delphi com, i can show it to you
and if u need the delphi com project, i will send it for you.



[2004-04-28 09:31:14] [EMAIL PROTECTED]

Are you running CGI, CLI, IIS or Apache module ?




[2004-04-23 10:26:23] kaija_jan at hotmail dot com

It's output the same in this case.
I had tried this way.
And I also tried to print out each byte of e and d(even a) in the
DELPHI COM Object.

*It's different between e and d(or a).*

It's the same if you try to return the string from the Object. But It's
different in the object.
This problem confused me for a long time.

Notice : I'm not sure if it is the same result in Visual C++
COM.(Delphi COM crashed php, but VC COM didn't.) I'm not a good C
programmer :(. I can't help you about this.

=
output:
d is a4a4a4e5
e is a4a4a4e5
=



[2004-04-23 09:53:46] [EMAIL PROTECTED]

Could you please adjust your COM object to return e instead, and paste
the output of this script here?

?php
$a = $b = $c = $d = 中文; //some chinese words
$comtest = new COM(comtest.test1);
$e = $comtest-comparestr($a, $b, $c, $d);
echo d is  . bin2hex($d) . \n;
echo e is  . bin2hex($e) . \n;
?




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/28117

-- 
Edit this bug report at http://bugs.php.net/?id=28117edit=1


#28117 [Fbk-Opn]: chinese comparision in delphi 5 COM object

2004-04-28 Thread kaija_jan at hotmail dot com
 ID:   28117
 User updated by:  kaija_jan at hotmail dot com
 Reported By:  kaija_jan at hotmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: COM related
 Operating System: windows 2k
 PHP Version:  5.0.0RC1
 New Comment:

iis 5 and apache 2
if you need hex output in delphi com, i can show it to you
and if u need the delphi com project, i will send it for you.


Previous Comments:


[2004-04-28 09:31:14] [EMAIL PROTECTED]

Are you running CGI, CLI, IIS or Apache module ?




[2004-04-28 03:38:04] kaija_jan at hotmail dot com

Does this problem is a bug?
It shows the same in RC2. :(



[2004-04-23 10:26:23] kaija_jan at hotmail dot com

It's output the same in this case.
I had tried this way.
And I also tried to print out each byte of e and d(even a) in the
DELPHI COM Object.

*It's different between e and d(or a).*

It's the same if you try to return the string from the Object. But It's
different in the object.
This problem confused me for a long time.

Notice : I'm not sure if it is the same result in Visual C++
COM.(Delphi COM crashed php, but VC COM didn't.) I'm not a good C
programmer :(. I can't help you about this.

=
output:
d is a4a4a4e5
e is a4a4a4e5
=



[2004-04-23 09:53:46] [EMAIL PROTECTED]

Could you please adjust your COM object to return e instead, and paste
the output of this script here?

?php
$a = $b = $c = $d = 中文; //some chinese words
$comtest = new COM(comtest.test1);
$e = $comtest-comparestr($a, $b, $c, $d);
echo d is  . bin2hex($d) . \n;
echo e is  . bin2hex($e) . \n;
?




[2004-04-23 09:13:34] kaija_jan at hotmail dot com

$obj = new COM(comtest.test1, null, 950);

I got the same result after I modify the codepage parameter.
==
a=b
c=d
a=c
ae
ce
==

And I tried each codepage under.
CP_ACP, CP_MACCP, CP_OEMCP, CP_UTF7, CP_UTF8, CP_SYMBOL, 
CP_THREAD_ACP

I also tried the same code in PHP 4.3.6(It crashes php in 4.3.4), It
gives me the same result as PHP 5 RC1.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/28117

-- 
Edit this bug report at http://bugs.php.net/?id=28117edit=1


#28117 [Opn]: chinese comparision in delphi 5 COM object

2004-04-27 Thread kaija_jan at hotmail dot com
 ID:   28117
 User updated by:  kaija_jan at hotmail dot com
 Reported By:  kaija_jan at hotmail dot com
 Status:   Open
 Bug Type: COM related
 Operating System: windows 2k
 PHP Version:  5.0.0RC1
 New Comment:

Does this problem is a bug?
It shows the same in RC2. :(


Previous Comments:


[2004-04-23 10:26:23] kaija_jan at hotmail dot com

It's output the same in this case.
I had tried this way.
And I also tried to print out each byte of e and d(even a) in the
DELPHI COM Object.

*It's different between e and d(or a).*

It's the same if you try to return the string from the Object. But It's
different in the object.
This problem confused me for a long time.

Notice : I'm not sure if it is the same result in Visual C++
COM.(Delphi COM crashed php, but VC COM didn't.) I'm not a good C
programmer :(. I can't help you about this.

=
output:
d is a4a4a4e5
e is a4a4a4e5
=



[2004-04-23 09:53:46] [EMAIL PROTECTED]

Could you please adjust your COM object to return e instead, and paste
the output of this script here?

?php
$a = $b = $c = $d = 中文; //some chinese words
$comtest = new COM(comtest.test1);
$e = $comtest-comparestr($a, $b, $c, $d);
echo d is  . bin2hex($d) . \n;
echo e is  . bin2hex($e) . \n;
?




[2004-04-23 09:13:34] kaija_jan at hotmail dot com

$obj = new COM(comtest.test1, null, 950);

I got the same result after I modify the codepage parameter.
==
a=b
c=d
a=c
ae
ce
==

And I tried each codepage under.
CP_ACP, CP_MACCP, CP_OEMCP, CP_UTF7, CP_UTF8, CP_SYMBOL, 
CP_THREAD_ACP

I also tried the same code in PHP 4.3.6(It crashes php in 4.3.4), It
gives me the same result as PHP 5 RC1.



[2004-04-23 08:32:17] [EMAIL PROTECTED]

You need to tell COM that the text is chinese.
There are two ways to achieve this:

set com.code_page ini setting to the number corresponding to chinese
(this is the default code_page used by PHP--the default is CP_ACP), or
set the code_page in the third parameter of the COM constructor:

$obj = new COM(comtest.test1, null, $codepage);

PHP defines these constants for codepages; they can be
used both in your scripts and in the php.ini:

CP_ACP
CP_MACCP
CP_OEMCP
CP_UTF7
CP_UTF8
CP_SYMBOL
CP_THREAD_ACP

You can use the numeric value for the chinese code page directly if you
know it (you probably want 950 or 936).  Consult MSDN for more
information:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/act/htm/actml_ref_scpg.asp





[2004-04-23 07:30:43] kaija_jan at hotmail dot com

Description:

I wrote a COM object by using delphi 5.
It do some comparision in the delphi object like the following code.

function Ttest.comparestr(const a, b: WideString; c,
  d: OleVariant): OleVariant;
var
e : widestring;
r : olevariant;
begin
e := '中文';
r := '';

if a = b then
r := r + 'a=bbr'
else
r := r + 'abbr';

if c = d then
r := r + 'c=dbr'
else
r := r + 'cdbr';

if a = c then
r := r + 'a=cbr'
else
r := r + 'acbr';

if a = e then
r := r + 'a=ebr'
else
r := r + 'aebr';

if c = e then
r := r + 'c=ebr'
else
r := r + 'cebr';

result := r;
end;


It always shows ae and ce(others equal) when I use PHP COM funcion,
and do chinese comparision. But It prints all equal if I send pure
english words or some numeral vairants.
And It shows all equal while I using asp to call the COM object,
whatever I send chinese or english.

Reproduce code:
---
?php
$a = $b = $c = $d = 中文; //some chinese words

$comtest = new COM(comtest.test1);

echo $comtest-comparestr($a, $b, $c, $d);

unset($comtest);
?

php outputs:
a=b
c=d
a=c
ae
ce

=
%
a = 中文 'some chinese words
b = a
c = a
d = a

set comtest = server.createobject(comtest.test1)

response.write comtest.comparestr(a, b, c, d)

set comtest = nothing
%

asp outputs:
a=b
c=d
a=c
a=e
c=e

Expected result:

output:
a=b
c=d
a=c
a=e
c=e

Actual result:
--
output:
a=b
c=d
a=c
ae
ce





-- 
Edit this bug report at http://bugs.php.net/?id=28117edit=1


#28117 [Fbk-Opn]: chinese comparision in delphi 5 COM object

2004-04-23 Thread kaija_jan at hotmail dot com
 ID:   28117
 User updated by:  kaija_jan at hotmail dot com
 Reported By:  kaija_jan at hotmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: COM related
 Operating System: windows 2k
 PHP Version:  5.0.0RC1
 New Comment:

$obj = new COM(comtest.test1, null, 950);

I got the same result after I modify the codepage parameter.
==
a=b
c=d
a=c
ae
ce
==

And I tried each codepage under.
CP_ACP, CP_MACCP, CP_OEMCP, CP_UTF7, CP_UTF8, CP_SYMBOL, 
CP_THREAD_ACP

I also tried the same code in PHP 4.3.6(It crashes php in 4.3.4), It
gives me the same result as PHP 5 RC1.


Previous Comments:


[2004-04-23 08:32:17] [EMAIL PROTECTED]

You need to tell COM that the text is chinese.
There are two ways to achieve this:

set com.code_page ini setting to the number corresponding to chinese
(this is the default code_page used by PHP--the default is CP_ACP), or
set the code_page in the third parameter of the COM constructor:

$obj = new COM(comtest.test1, null, $codepage);

PHP defines these constants for codepages; they can be
used both in your scripts and in the php.ini:

CP_ACP
CP_MACCP
CP_OEMCP
CP_UTF7
CP_UTF8
CP_SYMBOL
CP_THREAD_ACP

You can use the numeric value for the chinese code page directly if you
know it (you probably want 950 or 936).  Consult MSDN for more
information:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/act/htm/actml_ref_scpg.asp





[2004-04-23 07:30:43] kaija_jan at hotmail dot com

Description:

I wrote a COM object by using delphi 5.
It do some comparision in the delphi object like the following code.

function Ttest.comparestr(const a, b: WideString; c,
  d: OleVariant): OleVariant;
var
e : widestring;
r : olevariant;
begin
e := '中文';
r := '';

if a = b then
r := r + 'a=bbr'
else
r := r + 'abbr';

if c = d then
r := r + 'c=dbr'
else
r := r + 'cdbr';

if a = c then
r := r + 'a=cbr'
else
r := r + 'acbr';

if a = e then
r := r + 'a=ebr'
else
r := r + 'aebr';

if c = e then
r := r + 'c=ebr'
else
r := r + 'cebr';

result := r;
end;


It always shows ae and ce(others equal) when I use PHP COM funcion,
and do chinese comparision. But It prints all equal if I send pure
english words or some numeral vairants.
And It shows all equal while I using asp to call the COM object,
whatever I send chinese or english.

Reproduce code:
---
?php
$a = $b = $c = $d = 中文; //some chinese words

$comtest = new COM(comtest.test1);

echo $comtest-comparestr($a, $b, $c, $d);

unset($comtest);
?

php outputs:
a=b
c=d
a=c
ae
ce

=
%
a = 中文 'some chinese words
b = a
c = a
d = a

set comtest = server.createobject(comtest.test1)

response.write comtest.comparestr(a, b, c, d)

set comtest = nothing
%

asp outputs:
a=b
c=d
a=c
a=e
c=e

Expected result:

output:
a=b
c=d
a=c
a=e
c=e

Actual result:
--
output:
a=b
c=d
a=c
ae
ce





-- 
Edit this bug report at http://bugs.php.net/?id=28117edit=1


#28117 [Fbk-Opn]: chinese comparision in delphi 5 COM object

2004-04-23 Thread kaija_jan at hotmail dot com
 ID:   28117
 User updated by:  kaija_jan at hotmail dot com
 Reported By:  kaija_jan at hotmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: COM related
 Operating System: windows 2k
 PHP Version:  5.0.0RC1
 New Comment:

It's output the same in this case.
I had tried this way.
And I also tried to print out each byte of e and d(even a) in the
DELPHI COM Object.

*It's different between e and d(or a).*

It's the same if you try to return the string from the Object. But It's
different in the object.
This problem confused me for a long time.

Notice : I'm not sure if it is the same result in Visual C++
COM.(Delphi COM crashed php, but VC COM didn't.) I'm not a good C
programmer :(. I can't help you about this.

=
output:
d is a4a4a4e5
e is a4a4a4e5
=


Previous Comments:


[2004-04-23 09:53:46] [EMAIL PROTECTED]

Could you please adjust your COM object to return e instead, and paste
the output of this script here?

?php
$a = $b = $c = $d = 中文; //some chinese words
$comtest = new COM(comtest.test1);
$e = $comtest-comparestr($a, $b, $c, $d);
echo d is  . bin2hex($d) . \n;
echo e is  . bin2hex($e) . \n;
?




[2004-04-23 09:13:34] kaija_jan at hotmail dot com

$obj = new COM(comtest.test1, null, 950);

I got the same result after I modify the codepage parameter.
==
a=b
c=d
a=c
ae
ce
==

And I tried each codepage under.
CP_ACP, CP_MACCP, CP_OEMCP, CP_UTF7, CP_UTF8, CP_SYMBOL, 
CP_THREAD_ACP

I also tried the same code in PHP 4.3.6(It crashes php in 4.3.4), It
gives me the same result as PHP 5 RC1.



[2004-04-23 08:32:17] [EMAIL PROTECTED]

You need to tell COM that the text is chinese.
There are two ways to achieve this:

set com.code_page ini setting to the number corresponding to chinese
(this is the default code_page used by PHP--the default is CP_ACP), or
set the code_page in the third parameter of the COM constructor:

$obj = new COM(comtest.test1, null, $codepage);

PHP defines these constants for codepages; they can be
used both in your scripts and in the php.ini:

CP_ACP
CP_MACCP
CP_OEMCP
CP_UTF7
CP_UTF8
CP_SYMBOL
CP_THREAD_ACP

You can use the numeric value for the chinese code page directly if you
know it (you probably want 950 or 936).  Consult MSDN for more
information:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/act/htm/actml_ref_scpg.asp





[2004-04-23 07:30:43] kaija_jan at hotmail dot com

Description:

I wrote a COM object by using delphi 5.
It do some comparision in the delphi object like the following code.

function Ttest.comparestr(const a, b: WideString; c,
  d: OleVariant): OleVariant;
var
e : widestring;
r : olevariant;
begin
e := '中文';
r := '';

if a = b then
r := r + 'a=bbr'
else
r := r + 'abbr';

if c = d then
r := r + 'c=dbr'
else
r := r + 'cdbr';

if a = c then
r := r + 'a=cbr'
else
r := r + 'acbr';

if a = e then
r := r + 'a=ebr'
else
r := r + 'aebr';

if c = e then
r := r + 'c=ebr'
else
r := r + 'cebr';

result := r;
end;


It always shows ae and ce(others equal) when I use PHP COM funcion,
and do chinese comparision. But It prints all equal if I send pure
english words or some numeral vairants.
And It shows all equal while I using asp to call the COM object,
whatever I send chinese or english.

Reproduce code:
---
?php
$a = $b = $c = $d = 中文; //some chinese words

$comtest = new COM(comtest.test1);

echo $comtest-comparestr($a, $b, $c, $d);

unset($comtest);
?

php outputs:
a=b
c=d
a=c
ae
ce

=
%
a = 中文 'some chinese words
b = a
c = a
d = a

set comtest = server.createobject(comtest.test1)

response.write comtest.comparestr(a, b, c, d)

set comtest = nothing
%

asp outputs:
a=b
c=d
a=c
a=e
c=e

Expected result:

output:
a=b
c=d
a=c
a=e
c=e

Actual result:
--
output:
a=b
c=d
a=c
ae
ce





-- 
Edit this bug report at http://bugs.php.net/?id=28117edit=1


#28117 [NEW]: chinese comparision in delphi 5 COM object

2004-04-22 Thread kaija_jan at hotmail dot com
From: kaija_jan at hotmail dot com
Operating system: windows 2k
PHP version:  5.0.0RC1
PHP Bug Type: COM related
Bug description:  chinese comparision in delphi 5 COM object

Description:

I wrote a COM object by using delphi 5.
It do some comparision in the delphi object like the following code.

function Ttest.comparestr(const a, b: WideString; c,
  d: OleVariant): OleVariant;
var
e : widestring;
r : olevariant;
begin
e := '中文';
r := '';

if a = b then
r := r + 'a=bbr'
else
r := r + 'abbr';

if c = d then
r := r + 'c=dbr'
else
r := r + 'cdbr';

if a = c then
r := r + 'a=cbr'
else
r := r + 'acbr';

if a = e then
r := r + 'a=ebr'
else
r := r + 'aebr';

if c = e then
r := r + 'c=ebr'
else
r := r + 'cebr';

result := r;
end;


It always shows ae and ce(others equal) when I use PHP COM funcion,
and do chinese comparision. But It prints all equal if I send pure english
words or some numeral vairants.
And It shows all equal while I using asp to call the COM object, whatever
I send chinese or english.

Reproduce code:
---
?php
$a = $b = $c = $d = 中文; //some chinese words

$comtest = new COM(comtest.test1);

echo $comtest-comparestr($a, $b, $c, $d);

unset($comtest);
?

php outputs:
a=b
c=d
a=c
ae
ce

=
%
a = 中文 'some chinese words
b = a
c = a
d = a

set comtest = server.createobject(comtest.test1)

response.write comtest.comparestr(a, b, c, d)

set comtest = nothing
%

asp outputs:
a=b
c=d
a=c
a=e
c=e

Expected result:

output:
a=b
c=d
a=c
a=e
c=e

Actual result:
--
output:
a=b
c=d
a=c
ae
ce

-- 
Edit bug report at http://bugs.php.net/?id=28117edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28117r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28117r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=28117r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=28117r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28117r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=28117r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=28117r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=28117r=support
Expected behavior:  http://bugs.php.net/fix.php?id=28117r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=28117r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=28117r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=28117r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28117r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=28117r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=28117r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=28117r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28117r=float


#27770 [NEW]: reading data from Access thrugh COM function

2004-03-30 Thread kaija_jan at hotmail dot com
From: kaija_jan at hotmail dot com
Operating system: windows 2k
PHP version:  5.0.0RC1
PHP Bug Type: COM related
Bug description:  reading data from Access thrugh COM function

Description:

i try to use COM function to read data from Access database.

but if the fields type is ole object. the data will different with the asp
code.

here is my php code. the type of field test is oleobject.

there is no error during run time.

Reproduce code:
---
?

$oConn = new COM(ADODB.Connection);



$oConn-Open(Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\abc.mdb);



$oRs = $oConn-Execute(select * from test);



$a = c:\abc;



while(!$oRs-EOF)

{

$Data = $oRs-Fields-[test]-value;



$oRs-MoveNext();

}



$oRs-Close();

$oConn-Close();



$oRs-Release();



unset($oRs);

unset($oConn);

?


-- 
Edit bug report at http://bugs.php.net/?id=27770edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27770r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27770r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=27770r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=27770r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27770r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=27770r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=27770r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=27770r=support
Expected behavior:  http://bugs.php.net/fix.php?id=27770r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=27770r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=27770r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=27770r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27770r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=27770r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=27770r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=27770r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27770r=float