﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Релиб / Веб-программирование / PHP  / PHP5 &amp; DOM / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Релиб</description><link>http://www.relib.com/forums/</link><webMaster>robot@relib.com</webMaster><lastBuildDate>Sat, 22 Nov 2008 20:24:43 GMT</lastBuildDate><ttl>20</ttl><item><title>PHP5 &amp; DOM</title><link>http://www.relib.com/forums/Topic893113-17-1.aspx</link><description>Есть вот такой код:[code]$dom = new DOMDocument( "1.0", "windows-1251" );$root = $dom-&gt;createElement( "root_node" );$root-&gt;setAttribute( "attribute", "значение" );$dom-&gt;appendChild( $root );$dom-&gt;saveXML();[/code]При выполнении выдается ошибка:[code]Warning: DOMDocument::saveXML() [function.saveXML]: output conversion failed due to conv error, bytes 0xE0 0xF2 0xF0 0xE8[/code]Ясно что ошибка здесь: [code]$root-&gt;setAttribute( "attribute", "значение" );[/code]Есть вариант - [code]iconv( "cp1251", "utf-8", "значение" )[/code], но он не подходит, очень уж во многих местах это придется делать, да и вообще некрасивое решение.Буду рад услышать ваши мысли на эту тему.</description><pubDate>Fri, 17 Mar 2006 14:36:00 GMT</pubDate><dc:creator>hungrypunk</dc:creator></item></channel></rss>