Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.2.0-BETA3
-
Fix Version/s: 1.2.0-RC1
-
Component/s: Import/Export
-
Labels:None
-
Environment:W2003 Server
MSSQL 2000 (Collation: Latin1_General_CI_AS)
PHP 5.2.5 (cli) (built: Nov 8 2007 23:18:51)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
Description
I'm testing doctrine 1.2.0-B3 connected to mssql 2000 for XML based exports.
We use latin1 (ISO-8859-1) as collation for the mssql server. When i now create an XML export in Doctrine, Doctrine uses SimpleXML which requires the strings encoded in UTF-8, but our mssql collation is latin1. This results in a invalid, non UTF-8 XML file.
It's required to add the ability to convert the strings from the database encoding to the 'export' encoding.
(similar to http://trac.doctrine-project.org/ticket/1887)
I have added a simple patch to add this possibility, then we can do something like this:
Doctrine_Parser::dump($data->toArray(false, true), 'xml', 'testExport.xml', 'ISO-8859-1');
Because arrayToXml is a recursive method, add the encoding parameter to the recursive method call.
I think the use of htmlentities is not recommended, because the method doesn't create XML compliant strings.
If you want to use the function, use it with encoding.