Not exactly. Look below
// remove specials chars from 0x00 to 0x1F
var_dump($encodeData);
$encodeData = preg_replace(’/[\x{00}-\x{1F}]+/u’, ‘’, $encodeData); (line 374 in my copy of SVN trunk 4098)
var_dump($encodeData);
return $encodeData;
I’m afraid you forget to insert the link to purchaseorder2.pdf. You say that special chars seems to be ok now. What didi you change? Did you insert my code before line 322?
It works fine for me but only after the change at line 322 and other little changes. In my test there were these chars:
\ " ò ç à ° ù § è é [ { } ] ì ^ € ¢ © & ’ < >
Let me know if you need other special chars.
Below you can see the actual state of encodeData() function in my working copy:
public function encodeData($encodeData)
{
// XML charset of OpenOffice / OpenDocument / Word 2007 is utf-8
switch($this->getCharset())
{
case 'ISO 8859-1':
case 'ISO 8859-15':
$encodeData = utf8_encode($encodeData);
break;
case 'UTF-8':
case 'UTF8':
default:
//MIKE start pERP does not set charset option so tinyDoc assumes default UTF-8
$encodeData = htmlspecialchars(utf8_encode($encodeData));
//MIKE end
break;
}
//MIKE start No need to do it after $encodeData = htmlspecialchars(utf8_encode($encodeData));
// convert special XML chars
//$encodeData = str_replace(’&’ ,’&’, $encodeData); // the ‘&’ has to be the first to convert
//$encodeData = str_replace(’’’ ,’’’, $encodeData);
//$encodeData = str_replace(’"’ ,’"’, $encodeData);
//MIKE end
Regards
Michele