forked from spip/porte_plume
Browse Source
Exemple de déclaration dans mes_options.php si les accents ne s'affichent toujours pas correctement : // forcer le charset du PP car le charset de la bdd n'est pas connu define('PORTE_PLUME_PREVIEW_CHARSET', 'utf-8');2.1

4 changed files with 61 additions and 6 deletions
@ -1,6 +1,6 @@
|
||||
#CACHE{0} |
||||
#HTTP_HEADER{Content-Type: text/html; charset=#CHARSET} |
||||
#CACHE{0} |
||||
[(#HTTP_HEADER{Content-Type: text/html; charset=[(#VAL|pp_charset)]})] |
||||
<div class="preview"> |
||||
[(#ENV*{data}|traitements_previsu{#ENV*{champ},#ENV*{objet}}|image_reduire{500,0}|liens_absolus)] |
||||
[<hr style='clear:both;' /><div class="notes">(#NOTES)</div>] |
||||
</div> |
||||
</div> |
||||
|
@ -0,0 +1,20 @@
|
||||
<?php |
||||
|
||||
// retourner le charset SQL si on le connait, en priorite |
||||
// sinon, on utilise le charset de l'affichage HTML. |
||||
// Cependant, on peut forcer un charset donne avec une constante : |
||||
// define('PORTE_PLUME_PREVIEW_CHARSET','utf-8'); |
||||
function filtre_pp_charset() { |
||||
if (defined('PORTE_PLUME_PREVIEW_CHARSET')) { |
||||
return PORTE_PLUME_PREVIEW_CHARSET; |
||||
} |
||||
|
||||
$charset = $GLOBALS['charset']; |
||||
$charset_sql = isset($GLOBALS['charset_sql_base']) ? $GLOBALS['charset_sql_base'] : ''; |
||||
if ($charset_sql == 'utf8') { |
||||
$charset_sql = 'utf-8'; |
||||
} |
||||
return $charset_sql ? $charset_sql : $charset; |
||||
} |
||||
|
||||
?> |
Loading…
Reference in new issue