3 * Fonctions pour la prévisualisation
5 * @plugin Porte Plume pour SPIP
7 * @package SPIP\PortePlume\Fonctions
10 if (!defined('_ECRIRE_INC_VERSION')) return;
14 * Retourner le charset SQL
16 * Retourne le charset SQL si on le connait, en priorité
17 * sinon, on utilise le charset de l'affichage HTML.
19 * Cependant, on peut forcer un charset donné avec une constante :
20 * define('PORTE_PLUME_PREVIEW_CHARSET','utf-8');
22 * @return string Nom du charset (ex: 'utf-8')
24 function filtre_pp_charset() {
25 if (defined('PORTE_PLUME_PREVIEW_CHARSET')) {
26 return PORTE_PLUME_PREVIEW_CHARSET
;
29 $charset = $GLOBALS['meta']['charset'];
30 $charset_sql = isset($GLOBALS['charset_sql_base']) ?
$GLOBALS['charset_sql_base'] : '';
31 if ($charset_sql == 'utf8') {
32 $charset_sql = 'utf-8';
34 return $charset_sql ?
$charset_sql : $charset;