From:             consensus at gmail dot com
Operating system: any
PHP version:      5.2.1
PHP Bug Type:     SimpleXML related
Bug description:  SimpleXML enforces wrong charset

Description:
------------
SimpleXML has a wrong behaviour (yes it is defined, but still wrong)
regarding the charset.

SimpleXML is able to read any xml file as long as the charset is given in
the xml header (encoding="...")
But when it gives back values it does not recognize the encoding anymore
and forces utf-8.

While this might be defined behaviour it is still a very unclean/ignorant
feature.
It is the only function i know which behaves like this.

Charsets do have their good reason.
and ofcourse you can convert each value you get into the correct charset.
But here why this is generally a bad idea:
a) Everyone expects the function to not change the charset.
b) This is a big waste of cputime.
   If you have millions of values you have millions of 
   function calls to reconvert them all!
   Depending on the application you write this can get a 
   real problem.


I suggest to rethink about this design decision as it will be a problem
for many others too over the time.


-- 
Edit bug report at http://bugs.php.net/?id=40433&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40433&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40433&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40433&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40433&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40433&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40433&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40433&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40433&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40433&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40433&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40433&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40433&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40433&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40433&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40433&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40433&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40433&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40433&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40433&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40433&r=mysqlcfg

Reply via email to