Re: XML encoding variable simpleXML on Linux
| From: | Bojan Tesanovic | Date: | Fri, 22 Feb 2008 16:20:02 +0000 |
| Subject: | Re: XML encoding variable simpleXML on Linux | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-269881@lists.php.net to get a copy of this message | ||
encoding="UTF-8" doesn't guarantee that XML is encoded in UTF-8 its only purpose is to tell XML parser how to decode that XML document . it is responsibility of document creator to ensure that XML is proper UTF-8 document .
on PHP side when creating XML there are number of functions to ensure UTF-8 strings though there are some issues in PHP5 ,
and one of the main features of upcoming PHP6 is to address UTF-8 Issues that current PHP has.
some of UTF functions
utf8_encode — Encodes an ISO-8859-1 string to UTF-8
string utf8_encode ( string $data )
On Feb 22, 2008, at 4:52 PM, Larry Brown wrote:
I am using PHP on Linux to communicate with an XML peer. I pull and push documents from and to their server. On the console I use UTF-8 as far as I can tell. When I send these documents should my leading tag read: <?xml versionnn="1.0" encoding="UTF-8"?> or is the encoding done by PHP and how do I know what it is encoded to? TIA Larry --PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpBojan Tesanovic http://www.classicio.com/ http://www.real-estates-sale.com/