From 93075b9b6ad6211c90144d4ebe9c2e3734a9aa21 Mon Sep 17 00:00:00 2001 From: erikn69 Date: Thu, 16 Jun 2022 18:10:24 -0500 Subject: [PATCH] `mb_convert_encoding` support --- src/nusoap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nusoap.php b/src/nusoap.php index 2e9b79d..1f65e66 100755 --- a/src/nusoap.php +++ b/src/nusoap.php @@ -7141,7 +7141,7 @@ function character_data($parser, $data) // raw UTF-8 that, e.g., might not map to iso-8859-1 // TODO: this can also be handled with xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, "ISO-8859-1"); if ($this->decode_utf8) { - $data = utf8_decode($data); + $data = function_exists('mb_convert_encoding') ? mb_convert_encoding($data, 'ISO-8859-1', 'UTF-8') : utf8_decode($data); } } $this->message[$pos]['cdata'] .= $data;