Quantcast
Channel: PHPWord
Viewing all articles
Browse latest Browse all 450

Created Unassigned: please add a function to Template.php [63]

$
0
0
because my file 's charset is utf-8,not iso-8859-1.

thus,i remove utf8_encode relative lines:
if(!is_array($replace)) {
$replace = utf8_encode($replace);
}

and it become a new function "setValueByDefaultCharset" ,the last code is :

public function setValueByDefaultCharset($search, $replace) {
if(substr($search, 0, 2) !== '${' && substr($search, -1) !== '}') {
$search = '${'.$search.'}';
}



$this->_documentXML = str_replace($search, $replace, $this->_documentXML);
}

Viewing all articles
Browse latest Browse all 450

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>