mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-23 09:51:33 +01:00
Suuport UTF8 format
This commit is contained in:
@@ -456,7 +456,11 @@ function dolibarr_print_date($time,$format='',$to_gmt=false,$convtooutput=true)
|
|||||||
// Date is a timestamps
|
// Date is a timestamps
|
||||||
$ret=adodb_strftime($format,$time,$to_gmt);
|
$ret=adodb_strftime($format,$time,$to_gmt);
|
||||||
}
|
}
|
||||||
return ($convtooutput?$langs->convToOuptutCharset($ret):$ret);
|
|
||||||
|
// Page code for text from strftime functions
|
||||||
|
$pagecodefrom='ISO-8859-1';
|
||||||
|
|
||||||
|
return ($convtooutput?$langs->convToOuptutCharset($ret,$pagecodefrom):$ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -425,14 +425,15 @@ class Translate {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Convertit une chaine dans le charset de sortie
|
* \brief Convert a string into output charset (this->charset_output)
|
||||||
* \param str chaine a convertir
|
* \param str chaine a convertir
|
||||||
|
* \param pagecodefrom Page code of src string
|
||||||
* \return string chaine traduite
|
* \return string chaine traduite
|
||||||
*/
|
*/
|
||||||
function convToOuptutCharset($str)
|
function convToOuptutCharset($str,$pagecodefrom='UTF-8')
|
||||||
{
|
{
|
||||||
//if ($this->charset_output=='UTF-8') $str=utf8_encode($str);
|
if ($pagecodefrom == 'ISO-8859-1' && $this->charset_output == 'UTF-8') $str=utf8_encode($str);
|
||||||
if ($this->charset_output=='ISO-8859-1') $str=utf8_decode($str);
|
if ($pagecodefrom == 'UTF-8' && $this->charset_output == 'ISO-8859-1') $str=utf8_decode($str);
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user