Skip to content
Snippets Groups Projects
Commit f3db537f authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Amélioration du support UTF-8 pour la génération des pages Web.

La variable du charset d'affichage qui est mis dna sle fichier config est stocké dans l'objet $conf et non en session.
parent fcb7e9d7
Branches
Tags
No related merge requests found
......@@ -137,6 +137,7 @@ class MenuLeft {
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/dict.php", $langs->trans("DictionnarySetup"));
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/const.php", $langs->trans("OtherSetup"));
$newmenu->add(DOL_URL_ROOT."/admin/system/index.php?leftmenu=system", $langs->trans("DatabaseConnection"));
$newmenu->add(DOL_URL_ROOT."/admin/system/index.php?leftmenu=system", $langs->trans("SystemInfo"));
if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/dolibarr.php", $langs->trans("Dolibarr"),1);
if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/constall.php", $langs->trans("AllParameters"),2);
......
......@@ -42,12 +42,14 @@ $conffile = "../conf/conf.php";
$charset="ISO-8859-1";
if (file_exists($conffile))
{
include_once($conffile);
include_once($conffile); // Fichier conf charg
$charset=$character_set_client;
if ($dolibarr_main_document_root)
{
require_once($dolibarr_main_document_root . "/conf/conf.class.php");
$conf=new Conf();
if (! isset($character_set_client) || ! $character_set_client) $character_set_client='ISO-8859-1';
$conf->character_set_client=$character_set_client;
}
if ($dolibarr_main_document_root && $dolibarr_main_db_type && ! defined('DONOTLOADCONF'))
{
......
# Dolibarr language file - fr_FR - main
charset=iso-8859-1
CHARSET=ISO-8859-1
DatabaseConnection=Connexion à la base
SeparatorDecimal=,
SeparatorThousand=
Error=Erreur
......
......@@ -1292,7 +1292,7 @@ function accessforbidden($message='',$printheader=1)
*/
function dolibarr_print_error($db='',$error='')
{
global $langs,$argv;
global $conf,$langs,$argv;
$syslog = '';
// Si erreur intervenue avant chargement langue
......
......@@ -199,8 +199,8 @@ class Translate {
else
{
// On stocke toujours dans le tableau Tab en ISO
if ($this->charset_inputfile == 'ISO-8859-1') $value=$value;
if ($this->charset_inputfile == 'UTF-8') $value=utf8_decode($value);
//if ($this->charset_inputfile == 'ISO-8859-1') $value=$value;
$this->setTransFromTab($key,$value);
}
......@@ -256,7 +256,18 @@ class Translate {
$newstr=ereg_replace('>','__gt__',$newstr);
$newstr=ereg_replace('"','__quot__',$newstr);
/*
if ($key=='DatabaseConnection') {
print utf8_encode($newstr).'-'.$newstr;
print '-'.$this->charset_output;
print '-'.htmlentities($newstr,ENT_QUOTES,'UTF-8').'<br>';
}
*/
if ($this->charset_output=='UTF-8') $newstr=utf8_encode($newstr);
//if ($this->charset_output=='ISO-8859-1') $newstr=$newstr;
// Cryptage en html de la chaine
// $newstr est une chaine stockee en memoire au format $this->charset_output
$newstr=htmlentities($newstr,ENT_QUOTES,$this->charset_output);
// On restaure les tags HTML
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment