replace deprecated utf8_decode()

This commit is contained in:
Ortwin Pinke 2022-12-20 19:54:19 +01:00
parent b66c6fcf71
commit ba6d871ec0

View file

@ -130,12 +130,7 @@ class cI18n {
// Is emulator to use?
if (!$cfg['native_i18n']) {
$ret = self::emulateGettext($string, $domain);
// hopefully a proper replacement for
// mb_convert_encoding($string, 'HTML-ENTITIES', 'utf-8');
// see http://stackoverflow.com/q/11974008
$ret = htmlspecialchars_decode(utf8_decode(conHtmlentities($ret, ENT_COMPAT, 'utf-8', false)));
return $ret;
return mb_convert_encoding(self::emulateGettext($string, $domain), 'HTML-ENTITIES', 'utf-8');
}
// Try to use native gettext implementation