PDA

View Full Version : Problem with special characters and multilanguages



ogzille
19 Aug 2010, 03:03 AM
I created a simple comment wall that submits using ajax.

Using javascript i collect user input:

var sharetxt = encodeURIComponent(document.getElementById("cw_share_txt").value);
then pass it to a php page, on the php page, i collect the passed data:

$text=nl2br(htmlentities(trim(utf8_decode($_POST["txt"]))));
Encoding of the php page above:

header("Content-Type: text/xml; charset=utf-8");
My problem is that

the wall doesnt still support multi languages (displays as ???? and causes my xml not to work)

i still problems with some special characters (displays as � or ?)

What am i not doing right? please assist