XML cdata tgas being erased when there's input in Russian
Posted
by Uri
on Stack Overflow
See other posts from Stack Overflow
or by Uri
Published on 2010-06-15T11:29:10Z
Indexed on
2010/06/15
11:32 UTC
Read the original article
Hit count: 235
Hello, I have a very strange problem which I will be very thankful if someone would help me with.
I have a form that has a textarea whose content is later transferred to a page that has a line like this (using DOM with php to change data on an XML file):
$dom->getElementsByTagName("page")->item($itemNum)->getElementsByTagName("lang")->item(1)->getElementsByTagName("text")->item(0)->firstChild->data=$_POST['rus0'];
The XML file in question looks like this:
The strange thing happens when I upload it to the server and try to input Russian text, in which case it erases the CDATA completely and results in
And, weirdly, the thing works fine on my own server emulator (I'm using MAMP with php 5, the remote server also has php 5) - in my machine inputing Russian works fine.
Any ideas what's going on in this?
© Stack Overflow or respective owner