tags:

views:

275

answers:

1

I have created a test xml whose content is in gujrati using php

$doc = new DomDocument('1.0','UTF-8');
$fieldvalue = mb_convert_encoding($question['questiontext'],'ISO-8859-1','UTF-8');
$value2 = $doc->createTextNode($fieldvalue);

XML file is created successfully but when i try to use simplexml_load_file function to render the XML content i get the following errors:

Warning: simplexml_load_file() [function.simplexml-load-file]: testsxml/test27_4.xml:2: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xC9 0xD6 0xF7 0x20

+1  A: 

I have experienced the same problem, and it was solved by using utf8encode. I see you have use the multi byte version, but trying this might be worth a shot. Also make sure you are not encoding things twice.

One more thing. I suppose DomDocument does it for you, but check that & is & and so on.

antennen