I'm little bit confusing about utf-8 in XML and JSON Schema
I have following array
$array = array(
array('name'=>'abc', 'text'=>'اسلسصثصض صثصهخه عه☆anton & budi☆' ),
array('name'=>'xyz', 'text'=>'nice' ),
);
when i convert it to XML it give me this result
<?xml version="1.0"?>
<response>
<item>
<name>abc</name>
<text>اسلسصثصض صثصهخه عه☆anton '<&>' budi☆</text>
</item>
<item>
<name>xyz</name>
<text>nice</text>
</item>
</response>
Why the result is not like following :
<?xml version="1.0"?>
<response>
<item>
<name>abc</name>
<text>اسلسصثصض صثصهخه عه☆anton & budi☆</text>
</item>
<item>
<name>xyz</name>
<text>nice</text>
</item>
</response>
And When i convert it to JSON it will give me result :
[
{
"name": "abc",
"text": "\u0627\u0633\u0644\u0633\u0635\u062b\u0635\u0636 \u0635\u062b\u0635\u0647\u062e\u0647 \u0639\u0647\u2606anton '<&>' budi\u2606"
},
{
"name": "xyz",
"text": "nice"
}
]
and why not like this :
[
{
"name": "abc",
"text": "اسلسصثصض صثصهخه عه☆anton & budi☆"
},
{
"name": "xyz",
"text": "nice"
}
]
is that any way to use utf-8 character inside xml or json ? or that's are the standard ?