Page 1 of 1

XML: encoding='Windows-1252'

Posted: Fri Mar 13, 2009 9:56 am
by icepick
Hello good people

I need to produce a XML file with:

"<?xml version="1.0" encoding='Windows-1252' ?> "

I am using the XMLwriter extension on PHP 5.1.6, so the enconding should be declared on the startDocument() function, like this:

$obj = startDocument( '1.0' , 'Windows-1252' );

but then ... the script crashes!

I don't know why, but when using any other encoding string than 'UTF-8' my PHP script does not work.
However, when I use 'UTF-8' or simply use nothing at all, it works fine.

Can anyone tell me why is it happening?
Is there any workaround for it ?

Regards!