From: x2003bruneau Date: Fri, 2 Feb 2007 14:15:22 +0000 (+0000) Subject: Change locale to fr_FR.UTF-8 X-Git-Tag: xorg/0.9.14~303 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=3a824ce3e0ac4e8aeb002169197cd768504c7ec2;p=platal.git Change locale to fr_FR.UTF-8 Convert wiki to utf-8 Add scripts to: -> convert wiki -> convert the geoloc tables git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1463 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/configs/platal.ini b/configs/platal.ini index e7c76c4..bfe0b10 100644 --- a/configs/platal.ini +++ b/configs/platal.ini @@ -1,5 +1,5 @@ [Core] -locale = "fr_FR" +locale = "fr_FR.UTF-8" timezone = "Europe/Paris" [Banana] diff --git a/include/wiki/farmconfig.php b/include/wiki/farmconfig.php index 827029f..7c2a12c 100644 --- a/include/wiki/farmconfig.php +++ b/include/wiki/farmconfig.php @@ -18,6 +18,7 @@ $InterMapFiles[] = $globals->spoolroot.'/configs/pmwiki.intermap.txt'; $Skin = 'empty'; @include_once("$FarmD/cookbook/e-protect.php"); +include_once($FarmD.'/scripts/xlpage-utf-8.php'); // Theme-ing {{{ diff --git a/plugins/modifier.date_format.php b/plugins/modifier.date_format.php index 17469b0..8c22bcc 100644 --- a/plugins/modifier.date_format.php +++ b/plugins/modifier.date_format.php @@ -36,11 +36,11 @@ function smarty_modifier_date_format($string, $format = '%x', $default_date=null } if ( $t != -1 ) { - return utf8_encode(strftime($f , $t)); + return strftime($f , $t); } else { require_once('Date.php'); $date = new Date($d); - return utf8_encode($date->format($f)); + return $date->format($f); } } diff --git a/upgrade/0.9.14/connect.db.inc.php b/upgrade/0.9.14/connect.db.inc.php new file mode 120000 index 0000000..442fab7 --- /dev/null +++ b/upgrade/0.9.14/connect.db.inc.php @@ -0,0 +1 @@ +../../bin/connect.db.inc.php \ No newline at end of file diff --git a/upgrade/0.9.14/geoloc.utf8.php b/upgrade/0.9.14/geoloc.utf8.php new file mode 100755 index 0000000..6ec1649 --- /dev/null +++ b/upgrade/0.9.14/geoloc.utf8.php @@ -0,0 +1,41 @@ +#!/usr/bin/php5 +fetchAllAssoc(); + foreach ($all as &$array) { + $from = array(); + $to = array(); + foreach ($array as $key=>$value) { + $from[] = $key . '="' . mysql_real_escape_string($value) . '"'; + $valued = utf8_decode($value); + if (is_utf8($value) && $valued != $value) { + $to[] = $key . '="' . mysql_real_escape_string($valued) .'"'; + } + } + if (!empty($to)) { + $to = implode(', ', $to); + $from = implode(' AND ', $from); + $sql = "UPDATE geoloc_$table SET $to WHERE $from"; + if (!XDB::execute($sql)) { + echo "Echec : $sql\n"; + } + } + } +} + +?> diff --git a/upgrade/0.9.14/wiki.utf8.sh b/upgrade/0.9.14/wiki.utf8.sh new file mode 100644 index 0000000..06a90d5 --- /dev/null +++ b/upgrade/0.9.14/wiki.utf8.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +WIKISPOOLDIR='../../spool/wiki.d/' + +find $WIKISPOOLDIR -name 'cache_*' -or -name 'tmp_*' -exec rm {} ";" +for i in `find $WIKISPOOLDIR -type f`; do + mv $i $i.latin1 + iconv -t UTF-8 $i.latin1 > $i +done + +echo "Les pages de wiki ont ete converites en UTF-8" +echo "Verifie que tout c'est bien passe en presse ^D" +cat + +find $WIKISPOOLDIR -name '*.latin1' -exec rm {} ";"