For non-english charsets take a look at the PHP function htmlentities:
http://php.net/manual/en/function.htmlentities.php
I've just added to support croatian charset:
$nodeText .= (in_array($tagName, $this->CDATAEncoding))? $tagContent : htmlentities($tagContent, ENT_COMPAT, 'UTF-8');