* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
\***************************************************************************/
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined("_ECRIRE_INC_VERSION")) {
+ return;
+}
// Correction typographique anglaise
if (!isset($trans)) {
$trans = array(
- " " => '~',
- "'" => '’'
+ " " => '~',
+ "'" => '’'
);
- switch ($GLOBALS['meta']['charset']) {
+ $charset = isset($GLOBALS['meta']['charset']) ? $GLOBALS['meta']['charset'] : '';
+ switch ($charset) {
case 'utf-8':
$trans["\xc2\xa0"] = '~';
break;
/* 4 */
$t = preg_replace('/Mr\.? /S', '$0~', $t);
- if (strpos($t, '~') !== false)
+ if (strpos($t, '\~') !== false) {
+ $t = str_replace('\~', "\x1\x14", $t);
+ }
+
+ if (strpos($t, '~') !== false) {
$t = preg_replace("/ *~+ */S", "~", $t);
+ }
$t = preg_replace("/--([^-]|$)/S", "$pro—$1", $t, -1, $c);
if ($c) {
$t = str_replace('~', ' ', $t);
+ if (strpos($t, "\x1") !== false) {
+ $t = str_replace("\x1\x14", '~', $t);
+ }
+
return $t;
}