From:             
Operating system: CentOS 5.5
PHP version:      5.2.14
Package:          Strings related
Bug Type:         Bug
Bug description:html_entity_decode not working as expected with cp1252 encoding 
at least

Description:
------------
Hi,



There seems to be many bugs with html_entity_decode.



Using cp1252 encoding, it decodes HTML numeric entities as if encoding was
cp1251 

(please note that it works correctly on 5.3.3).

Using iso-8859-1 encoding does not seem to decode any numeric entity at all
(same 

situation in 5.3.3).



Please also note that &é is never decoded neither on 5.2.14 nor on
5.3.3.

Test script:
---------------
html_entity_decode('é&é é é&é é&
&é', ENT_NOQUOTES, 'cp1252');

html_entity_decode('é&é é é&é é&
&é', ENT_NOQUOTES, 'cp1251');

html_entity_decode('é&é é é&é é&
&é', ENT_NOQUOTES, 'iso-8859-1');

Expected result:
----------------
expected results :

é&é é é&é é& &é

é&é é é&é é& &é

é&é é é&é é& &é

Actual result:
--------------
results in 5.2.14 :

й&é й й&й й& &é

é&é é é&é é& &é

é&é é é&é é& &é



results in 5.3.3 :

é&é é é&é é& &é

é&é é é&é é& &é

é&é é é&é é& &é

-- 
Edit bug report at http://bugs.php.net/bug.php?id=53021&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=53021&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=53021&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=53021&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=53021&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53021&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=53021&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=53021&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=53021&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=53021&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=53021&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=53021&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=53021&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=53021&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=53021&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=53021&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=53021&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=53021&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=53021&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=53021&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=53021&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=53021&r=mysqlcfg

Reply via email to