diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 47f13598291..4bf8cbc959b 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3994,18 +3994,6 @@ function printCommonFooter($zone='private')
}
-/**
- * Convert unicode
- *
- * @param string $unicode Unicode
- * @param string $encoding Encoding type
- * @return string Unicode converted
- */
-function unichr($unicode , $encoding = 'UTF-8')
-{
- return mb_convert_encoding("{$unicode};", $encoding, 'HTML-ENTITIES');
-}
-
/**
* Convert an array with RGB value into hex RGB value
*
@@ -4035,11 +4023,11 @@ function getCurrencySymbol($currency_code)
$form->load_cache_currencies();
- if (is_array($form->cache_currencies[$currency_code]['unicode']) && ! empty($form->cache_currencies[$currency_code]['unicode']))
+ if (function_exists("mb_convert_encoding") && is_array($form->cache_currencies[$currency_code]['unicode']) && ! empty($form->cache_currencies[$currency_code]['unicode']))
{
foreach($form->cache_currencies[$currency_code]['unicode'] as $unicode)
{
- $currency_sign.= unichr($unicode);
+ $currency_sign .= mb_convert_encoding("{$unicode};", "UTF-8", 'HTML-ENTITIES');
}
}
else
diff --git a/htdocs/install/check.php b/htdocs/install/check.php
index b575e0c62a4..52a64f007fe 100644
--- a/htdocs/install/check.php
+++ b/htdocs/install/check.php
@@ -144,6 +144,18 @@ else
print '
'.$langs->trans("PHPSupportUTF8")."
\n";
}
+// Check if mb_convert_encoding supported (used by getCurrencySymbol)
+/*if (! function_exists("mb_convert_encoding"))
+{
+ $langs->load("errors");
+ print '
'.$langs->trans("ErrorPHPDoesNotSupportUTF8")."
\n";
+ // $checksok=0; // If image ko, just warning. So check must still be 1 (otherwise no way to install)
+}
+else
+{
+ print '
'.$langs->trans("PHPSupportUTF8")."
\n";
+}*/
+
// Check memory
$memrequiredorig='32M';