diff --git a/rtf-html-php.php b/rtf-html-php.php
index 5f9b693..59a7d32 100644
--- a/rtf-html-php.php
+++ b/rtf-html-php.php
@@ -920,7 +920,7 @@ protected function DecodeUnicode($code, $srcEnc = 'UTF-8')
$utf8 = '';
if ($srcEnc != 'UTF-8') { // convert character to Unicode
- $utf8 = iconv($srcEnc, 'UTF-8', chr($code));
+ $utf8 = iconv(mb_detect_encoding($code, mb_detect_order(), false), "UTF-8", $code);
}
if ($this->encoding == 'HTML-ENTITIES') {