Bug 63215

Summary: Iconv converting to/from UCS encoding - wrong results
Product: [Retired] Red Hat Linux Reporter: Itai Nahshon <itai.nahshon>
Component: phpAssignee: Joe Orton <jorton>
Status: CLOSED WONTFIX QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-04-05 12:24:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Suggested fix none

Description Itai Nahshon 2002-04-11 09:36:50 UTC
Description of Problem: 
Iconv can not handle encodings that 
may contain null bytes (eg. UCS2)    
 
Version-Release number of selected component (if applicable): 
php-4.0.6-15 
 
How Reproducible: 
<? 
        $s = iconv("UTF-8", "UCS-4BE", "string"); 
 
        $a = unpack("N*", $s); 
 
        foreach($a as $val) { 
                print "&#$val;"; 
        } 
        print "\n"; 
?> 
Actual Results:    
(empty line)   
 
Expected Results: 
&#115;&#116;&#114;&#105;&#110;&#103;

Comment 1 Itai Nahshon 2002-04-11 09:52:50 UTC
Created attachment 53386 [details]
Suggested fix

Comment 2 Itai Nahshon 2002-04-11 09:56:56 UTC
I'm using the attached patch for about 4 months 
applied over php-4.0.6-x from redHat's source 
RPMS. (I recompile php anyways because I also need 
the mcrypt extension). 
 
A similar patch was submitted for php-4.1 CVS. 
The Latest CVS version from PHP contains newer 
enhancements that I havn't tried yet. 


Comment 3 Joe Orton 2004-04-05 12:24:50 UTC
Thanks for the report.  Presuming this is fixed in php-4.1.x based
packages; please reopen if this bug is reproducible in current releases.