[SPIP] +2.1.12
[velocampus/web/www.git] / www / extensions / porte_plume / prive / porte_plume_preview_fonctions.php
1 <?php
2
3 if (!defined("_ECRIRE_INC_VERSION")) return;
4
5 // retourner le charset SQL si on le connait, en priorite
6 // sinon, on utilise le charset de l'affichage HTML.
7 // Cependant, on peut forcer un charset donne avec une constante :
8 // define('PORTE_PLUME_PREVIEW_CHARSET','utf-8');
9 function filtre_pp_charset() {
10 if (defined('PORTE_PLUME_PREVIEW_CHARSET')) {
11 return PORTE_PLUME_PREVIEW_CHARSET;
12 }
13
14 $charset = $GLOBALS['meta']['charset'];
15 $charset_sql = isset($GLOBALS['charset_sql_base']) ? $GLOBALS['charset_sql_base'] : '';
16 if ($charset_sql == 'utf8') {
17 $charset_sql = 'utf-8';
18 }
19 return $charset_sql ? $charset_sql : $charset;
20 }
21
22 ?>