0

I am taking a clob data of XSL from oracle 11g and trying to show the content in textarea of a php page using the following code

$recordSet = $db->Execute($v_sql);
$v_xsl =  $recordSet->fields[0];
$doc = new domDocument;
$doc->preserveWhiteSpace = false;
$doc->encoding = 'utf-8';
$doc->loadXML($v_xsl);      
$doc->formatOutput = true;
$v_xsl = $doc->saveXML();

<td><textarea name="xsl" rows=30 cols=100><?PHP echo htmlentities($v_xsl); ?></textarea></td>

this content gets loaded when there is no Korean characters where as if the content has korean characters it doesnt load the content in textarea.

the page header has charset as 'UTF-8'

  • Did you set meta charset="UTF-8" in the head of your html? Try also try adding htmlentitiles($v_xsl, null, "UTF-8"); – Dawid O Nov 25 '14 at 09:56
  • Yes i have used "UTF-8" as the meta charset and also i have used your suggestion but no improvement – Niki Jackson Nov 25 '14 at 10:24
  • Is it not showing in the text area or does the htmlentities returns null/empty string? – Dawid O Nov 25 '14 at 10:30
  • yes it returns null value when the content has korean characters – Niki Jackson Nov 25 '14 at 10:46
  • till this point it brings the data * $recordSet = $db->Execute($v_sql); * $v_xsl = $recordSet->fields[0]; after this it turns into null value $doc = new domDocument; $doc->preserveWhiteSpace = false; $doc->encoding = 'utf-8'; $doc->loadXML($v_xsl); $doc->formatOutput = true; $v_xsl = $doc->saveXML(); – Niki Jackson Nov 25 '14 at 10:48
  • http://stackoverflow.com/questions/11442529/converting-korean-characters-into-entities – Dawid O Nov 25 '14 at 11:02

0 Answers0