Anonymous | Login | Signup for a new account | 12-17-2024 08:56 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0002119 | [Quercus] | minor | always | 10-26-07 20:01 | 10-29-07 14:12 | ||||
Reporter | koreth | View Status | public | ||||||
Assigned To | ferg | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 3.1.3 | ||||||
Summary | 0002119: Binary values get altered when concatenated to a string | ||||||||
Description |
test/TestBinary.java: package test; import com.caucho.quercus.env.*; class TestBinary { public static BinaryValue doTest() { byte[] testArray = new byte[1]; testArray[0] = (byte)0x9c; return new BinaryBuilderValue(testArray); } } test.php: <?php import test.TestBinary; $var = TestBinary::doTest(); $fp = fopen("/tmp/x", "w"); fwrite($fp, $var); fwrite($fp, "x" . $var); fclose($fp); If you examine /tmp/x, you will see that the first fwrite() wrote the binary value, 0x9c. Then there's an "x" (0x78). Then, instead of another 0x9c, you'll see 0xfa. If you change the $var assignment to "$var = chr(156);" then you get the correct output; this only seems to manifest with binary values returned by Java code (it bit me in some custom serialization code.) Now that I've identified the problem I can work around it but it certainly seems like a bug. |
||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed. 26 unique queries executed. |