I have written a PHP program to create an XML file on the server with UTF-8 encoding. But the resulting XML file always returns the question mark (?????) instead of the Unicode characters, but in the local server, the result was justified. What can be the problem?
Here's the php code I used:
AppendChild ($ REC); $ Id = $ DOMObject- & gt; Create Element ("id"); $ Rec-> AppendChild ($ ID); $ IdText = $ DOMObject- & gt; CreateTextNode ("Mannarseri"); $ ID- & gt; AppendChild ($ idText); $ Name = $ DOMObject- & gt; Element ("name"); $ Rec-> AppendChild ($ name); $ NameText = $ DOMObject- & gt; CreateTextNode ("Alava." $ Name-> appendChild ($ nameText); $ DOMObject-> Save ('writers1.xml'); $ DOMObject-> SaveXML ();? & Gt;
Make sure the php file is also written in UTF-8.
Comments
Post a Comment