Suuport UTF8 format
This commit is contained in:
parent
5758db39d3
commit
91ee242a97
@ -456,7 +456,11 @@ function dolibarr_print_date($time,$format='',$to_gmt=false,$convtooutput=true)
|
||||
// Date is a timestamps
|
||||
$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
|
||||
* \param str chaine a convertir
|
||||
* \return string chaine traduite
|
||||
* \brief Convert a string into output charset (this->charset_output)
|
||||
* \param str chaine a convertir
|
||||
* \param pagecodefrom Page code of src string
|
||||
* \return string chaine traduite
|
||||
*/
|
||||
function convToOuptutCharset($str)
|
||||
function convToOuptutCharset($str,$pagecodefrom='UTF-8')
|
||||
{
|
||||
//if ($this->charset_output=='UTF-8') $str=utf8_encode($str);
|
||||
if ($this->charset_output=='ISO-8859-1') $str=utf8_decode($str);
|
||||
if ($pagecodefrom == 'ISO-8859-1' && $this->charset_output == 'UTF-8') $str=utf8_encode($str);
|
||||
if ($pagecodefrom == 'UTF-8' && $this->charset_output == 'ISO-8859-1') $str=utf8_decode($str);
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user