From 598a1c538cde55ef90fcacd7d09d36e025f64dee Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Thu, 11 Jan 2007 18:16:58 +0000 Subject: [PATCH] Convert sources to UTF-8 git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@155 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- banana/banana.inc.php.in | 16 ++++++++-------- banana/mbox.inc.php | 4 ++-- banana/message.func.inc.php | 6 +++--- banana/message.inc.php | 14 +++++++------- banana/mimepart.inc.php | 2 +- banana/nntp.inc.php | 2 +- banana/nntpcore.inc.php | 2 +- banana/page.inc.php | 6 +++--- banana/protocoleinterface.inc.php | 4 ++-- banana/spool.inc.php | 4 ++-- banana/templates/banana-base.tpl | 4 ++-- banana/templates/banana-boxlist.inc.tpl | 2 +- banana/templates/banana-message.inc.tpl | 8 ++++---- banana/templates/banana-newmessage.inc.tpl | 2 +- banana/templates/banana-thread.inc.tpl | 2 +- banana/text.func.inc.php | 5 +---- 16 files changed, 40 insertions(+), 43 deletions(-) diff --git a/banana/banana.inc.php.in b/banana/banana.inc.php.in index 0a28005..7245b02 100644 --- a/banana/banana.inc.php.in +++ b/banana/banana.inc.php.in @@ -55,7 +55,7 @@ class Banana * $matches[2] = "http://www.polytechnique.org" * $matches[3] = "]" */ - static public $msgshow_url = '(["\[])?((?:[a-z]+:\/\/|www\.)(?:[\.\,\;\!]*[a-z\@0-9~%$£µ&i#\-+=_\/\?]+)+)(["\]])?'; + static public $msgshow_url = '(["\[])?((?:[a-z]+:\/\/|www\.)(?:[\.\,\;\!]*[a-z\@0-9~%$£µ&i#\-+=_\/\?]+)+)(["\]])?'; ### Message edition ### static public $msgedit_canattach = true; @@ -200,7 +200,7 @@ class Banana // Check if the state is valid if (Banana::$protocole->lastErrNo()) { - return Banana::$page->kill(_b_('Une erreur a été rencontrée lors de la connexion au serveur') . '
' + return Banana::$page->kill(_b_('Une erreur a été rencontrée lors de la connexion au serveur') . '
' . Banana::$protocole->lastError()); } if (!Banana::$protocole->isValid()) { @@ -209,7 +209,7 @@ class Banana if (Banana::$action & Banana::ACTION_BOX_NEEDED) { if(Banana::$boxpattern && !preg_match('/' . Banana::$boxpattern . '/i', $group)) { Banana::$page->setPage('group'); - return Banana::$page->kill(_b_("Ce newsgroup n'existe pas ou vous n'avez pas l'autorisation d'y accéder")); + return Banana::$page->kill(_b_("Ce newsgroup n'existe pas ou vous n'avez pas l'autorisation d'y accéder")); } } @@ -234,7 +234,7 @@ class Banana $error = $this->action_cancelMessage(Banana::$group, Banana::$artid); break; default: - $error = _b_("L'action demandée n'est pas supportée par Banana"); + $error = _b_("L'action demandée n'est pas supportée par Banana"); } // Generate the page @@ -299,7 +299,7 @@ class Banana if (is_null($msg)) { $this->loadSpool($group); $this->removeMessage($group, $artid); - return _b_('Le message demandé n\'existe pas. Il est possible qu\'il ait été annulé'); + return _b_('Le message demandé n\'existe pas. Il est possible qu\'il ait été annulé'); } if ($partid == 'xface') { $msg->getXFace(); @@ -365,7 +365,7 @@ class Banana } elseif (Banana::$msgedit_canattach && isset($_FILES['attachment'])) { $uploaded = $_FILES['attachment']; if (!is_uploaded_file($uploaded['tmp_name'])) { - Banana::$page->trig(_b_('Une erreur est survenue lors du téléchargement du fichier')); + Banana::$page->trig(_b_('Une erreur est survenue lors du téléchargement du fichier')); } else { $msg = BananaMessage::newMessage($hdr_values, $_POST['body'], $uploaded); } @@ -382,7 +382,7 @@ class Banana } else { if (!is_null($artid)) { $msg =& $this->loadMessage($group, $artid); - $body = $msg->getSender() . _b_(' a écrit :') . "\n" . $msg->quote(); + $body = $msg->getSender() . _b_(' a écrit :') . "\n" . $msg->quote(); $subject = $msg->getHeaderValue('subject'); $headers['Subject']['user'] = 'Re: ' . preg_replace("/^re\s*:\s*/i", '', $subject); $target = $msg->getHeaderValue($hdrs['reply']); @@ -494,5 +494,5 @@ class Banana } } -// vim:set et sw=4 sts=4 ts=4 +// vim:set et sw=4 sts=4 ts=4 enc=utf-8: ?> diff --git a/banana/mbox.inc.php b/banana/mbox.inc.php index 4bd3401..1ddb5d5 100644 --- a/banana/mbox.inc.php +++ b/banana/mbox.inc.php @@ -61,7 +61,7 @@ class BananaMBox implements BananaProtocoleInterface return !Banana::$group || $this->file; } - /** Indicate last error n° + /** Indicate last error n° */ public function lastErrNo() { @@ -448,5 +448,5 @@ class BananaMBox implements BananaProtocoleInterface } } -// vim:set et sw=4 sts=4 ts=4: +// vim:set et sw=4 sts=4 ts=4 enc=utf-8: ?> diff --git a/banana/message.func.inc.php b/banana/message.func.inc.php index d60e4e9..db01d2f 100644 --- a/banana/message.func.inc.php +++ b/banana/message.func.inc.php @@ -88,7 +88,7 @@ function banana_catchFormats($text) '_' => 'u', '*' => 'strong'); $url = Banana::$msgshow_url; - preg_match_all("/$url/i", $text, $urls); + preg_match_all("/$url/ui", $text, $urls); $text = str_replace($urls[0], "&&&urls&&&", $text); foreach ($formatting as $limit=>$mark) { $limit = preg_quote($limit, '/'); @@ -138,7 +138,7 @@ function banana_catchURLs($text) $url = Banana::$msgshow_url; $res = preg_replace("/&(lt|gt|quot);/", " &\\1; ", $text); - $res = preg_replace("/$url/ie", "'\\1'.banana__cleanurl('\\2').'\\3'", $res); + $res = preg_replace("/$url/uie", "'\\1'.banana__cleanurl('\\2').'\\3'", $res); $res = preg_replace('/(["\[])?(?:mailto:|news:)?([a-z0-9.\-+_\$]+@([\-.+_]?[a-z0-9])+)(["\]])?/ie', "'\\1' . banana__catchMailLink('\\2') . '\\4'", $res); @@ -415,5 +415,5 @@ function banana_formatRichText(BananaMimePart &$part) // }}} -// vim:set et sw=4 sts=4 ts=4: +// vim:set et sw=4 sts=4 ts=4 enc=utf-8: ?> diff --git a/banana/message.inc.php b/banana/message.inc.php index 87485bc..db4e968 100644 --- a/banana/message.inc.php +++ b/banana/message.inc.php @@ -49,15 +49,15 @@ final class BananaMessage extends BananaMimePart case 'from': return _b_('De'); case 'subject': return _b_('Sujet'); case 'newsgroups': return _b_('Forums'); - case 'followup-to': return _b_('Suivi à'); - case 'to': return _b_('À'); - case 'cc': return _b_('Copie à'); - case 'bcc': return _b_('Copie cachée à'); - case 'reply-to': return _b_('Répondre à'); + case 'followup-to': return _b_('Suivi à'); + case 'to': return _b_('À'); + case 'cc': return _b_('Copie à'); + case 'bcc': return _b_('Copie cachée à'); + case 'reply-to': return _b_('Répondre à'); case 'date': return _b_('Date'); case 'organization': return _b_('Organisation'); case 'in-reply-to': - case 'references': return _b_('Références'); + case 'references': return _b_('Références'); case 'x-face': return _b_('Image'); } return $hdr; @@ -281,5 +281,5 @@ final class BananaMessage extends BananaMimePart } } -// vim:set et sw=4 sts=4 ts=4: +// vim:set et sw=4 sts=4 ts=4 enc=utf-8: ?> diff --git a/banana/mimepart.inc.php b/banana/mimepart.inc.php index d90a22b..a2d8220 100644 --- a/banana/mimepart.inc.php +++ b/banana/mimepart.inc.php @@ -510,5 +510,5 @@ class BananaMimePart } } -// vim:set et sw=4 sts=4 ts=4: +// vim:set et sw=4 sts=4 ts=4 enc=utf-8: ?> diff --git a/banana/nntp.inc.php b/banana/nntp.inc.php index 5b9cadd..37a354f 100644 --- a/banana/nntp.inc.php +++ b/banana/nntp.inc.php @@ -254,5 +254,5 @@ class BananaNNTP extends BananaNNTPCore implements BananaProtocoleInterface } } -// vim:set et sw=4 sts=4 ts=4: +// vim:set et sw=4 sts=4 ts=4 enc=utf-8: ?> diff --git a/banana/nntpcore.inc.php b/banana/nntpcore.inc.php index 071ae5f..4fbe022 100644 --- a/banana/nntpcore.inc.php +++ b/banana/nntpcore.inc.php @@ -507,5 +507,5 @@ class BananaNNTPCore } } -// vim:set et sw=4 sts=4 ts=4 +// vim:set et sw=4 sts=4 ts=4 enc=utf-8: ?> diff --git a/banana/page.inc.php b/banana/page.inc.php index f148566..4b24f4c 100644 --- a/banana/page.inc.php +++ b/banana/page.inc.php @@ -102,7 +102,7 @@ class BananaPage extends Smarty if ($this->page == 'cancel') { $this->registerPage('cancel', _b_('Annulation'), null); } elseif ($this->page == 'new') { - $this->registerPage('new', _b_('Répondre'), null); + $this->registerPage('new', _b_('Répondre'), null); } } elseif ($this->page == 'new') { $this->registerPage('new', _b_('Nouveau'), null); @@ -126,7 +126,7 @@ class BananaPage extends Smarty { $tpl = $this->prepare(); if (!isset($this->pages[$this->page])) { - $this->trig(_b_('La page demandée n\'existe pas')); + $this->trig(_b_('La page demandée n\'existe pas')); $this->actions = array(); $this->page = null; } @@ -340,5 +340,5 @@ function banana_trimwhitespace($source, &$smarty) // }}} -// vim:set et sw=4 sts=4 ts=4: +// vim:set et sw=4 sts=4 ts=4 enc=utf-8: ?> diff --git a/banana/protocoleinterface.inc.php b/banana/protocoleinterface.inc.php index 600ff19..1e3e12a 100644 --- a/banana/protocoleinterface.inc.php +++ b/banana/protocoleinterface.inc.php @@ -19,7 +19,7 @@ interface BananaProtocoleInterface */ public function isValid(); - /** Indicate last error n° + /** Indicate last error n° */ public function lastErrNo(); @@ -107,5 +107,5 @@ interface BananaProtocoleInterface public function filename(); } -// vim:set et sw=4 sts=4 ts=4: +// vim:set et sw=4 sts=4 ts=4 enc=utf-8: ?> diff --git a/banana/spool.inc.php b/banana/spool.inc.php index 8bb5537..9de8df8 100644 --- a/banana/spool.inc.php +++ b/banana/spool.inc.php @@ -518,7 +518,7 @@ class BananaSpool for ($i = 0; $i < $pos ; $i++) { $ndx += $this->overview[$this->overview[$id_parent]->children[$i]]->desc; } - $ndx++; //noeud père + $ndx++; //noeud père $id_cur = $id_parent; } @@ -687,5 +687,5 @@ class BananaSpool } } -// vim:set et sw=4 sts=4 ts=4 +// vim:set et sw=4 sts=4 ts=4 enc=utf-8: ?> diff --git a/banana/templates/banana-base.tpl b/banana/templates/banana-base.tpl index ba6a0b8..b74f786 100644 --- a/banana/templates/banana-base.tpl +++ b/banana/templates/banana-base.tpl @@ -34,7 +34,7 @@ {if $page eq 'forums'} {include file="banana-boxlist.inc.tpl" grouplist=$groups withstats=true} {if $newgroups|@count} -

Les nouveaux groupes suivants ont été créés depuis votre dernière visite

+

Les nouveaux groupes suivants ont été créés depuis votre dernière visite

{include file="banana-boxlist.inc.tpl" grouplist=$newgroups withstats=true} {/if} {elseif $page eq 'subscribe'} @@ -62,4 +62,4 @@ -{* vim:set et sw=2 sts=2 ts=2: *} +{* vim:set et sw=2 sts=2 ts=2 enc=utf-8: *} diff --git a/banana/templates/banana-boxlist.inc.tpl b/banana/templates/banana-boxlist.inc.tpl index c0cb3ed..7c12488 100644 --- a/banana/templates/banana-boxlist.inc.tpl +++ b/banana/templates/banana-boxlist.inc.tpl @@ -41,4 +41,4 @@ {/if} {/if} -{* vim:set et sw=2 sts=2 ts=2: *} +{* vim:set et sw=2 sts=2 ts=2 enc=utf-8: *} diff --git a/banana/templates/banana-message.inc.tpl b/banana/templates/banana-message.inc.tpl index a1d8556..678ce01 100644 --- a/banana/templates/banana-message.inc.tpl +++ b/banana/templates/banana-message.inc.tpl @@ -6,18 +6,18 @@ {if $spool->nextUnread($artid)} {imglink group=$group artid=$spool->nextUnread($artid) img=next_unread alt="Message non-lu suivant" accesskey=u}{/if} {if $spool->prevPost($artid)} - {imglink group=$group artid=$spool->prevPost($artid) img=prev alt="Message précédent" accesskey=a}{/if} + {imglink group=$group artid=$spool->prevPost($artid) img=prev alt="Message précédent" accesskey=a}{/if} {if $spool->nextPost($artid)} {imglink group=$group artid=$spool->nextPost($artid) img=next alt="Message suivant" accesskey=z}{/if} {if $spool->prevThread($artid)} - {imglink group=$group artid=$spool->prevThread($artid) img=prev_thread alt="Discussion précédente" accesskey=q}{/if} + {imglink group=$group artid=$spool->prevThread($artid) img=prev_thread alt="Discussion précédente" accesskey=q}{/if} {if $spool->nextThread($artid)} {imglink group=$group artid=$spool->nextThread($artid) img=next_thread alt="Discussion suivante" accesskey=s}{/if}
{if $message->canSend()} {imglink group=$group action="new" img=post alt="Nouveau messasge" accesskey=p} - {imglink group=$group artid=$artid action="new" img=reply alt="Répondre" accesskey=r} + {imglink group=$group artid=$artid action="new" img=reply alt="Répondre" accesskey=r} {/if} {if $message->canCancel()} {imglink group=$group artid=$artid action="cancel" img=cancel alt="Annuler" accesskey=c} @@ -59,4 +59,4 @@ -{* vim:set et sw=2 sts=2 ts=2: *} +{* vim:set et sw=2 sts=2 ts=2 enc=utf-8: *} diff --git a/banana/templates/banana-newmessage.inc.tpl b/banana/templates/banana-newmessage.inc.tpl index dd15111..668592b 100644 --- a/banana/templates/banana-newmessage.inc.tpl +++ b/banana/templates/banana-newmessage.inc.tpl @@ -39,4 +39,4 @@ -{* vim:set et sts=2 ts=2 sw=2: *} +{* vim:set et sts=2 ts=2 sw=2 enc=utf-8: *} diff --git a/banana/templates/banana-thread.inc.tpl b/banana/templates/banana-thread.inc.tpl index 60630fa..9265250 100644 --- a/banana/templates/banana-thread.inc.tpl +++ b/banana/templates/banana-thread.inc.tpl @@ -62,4 +62,4 @@
{/if} -{* vim:set et sw=2 sts=2 ts=2: *} +{* vim:set et sw=2 sts=2 ts=2 enc=utf-8: *} diff --git a/banana/text.func.inc.php b/banana/text.func.inc.php index 00d0385..48e9b1f 100644 --- a/banana/text.func.inc.php +++ b/banana/text.func.inc.php @@ -9,9 +9,6 @@ function _b_($str) { - if (!is_utf8($str)) { - $str = utf8_encode($str); - } return dgettext('banana', $str); } @@ -97,5 +94,5 @@ function banana_utf8entities($source) return $encodedString; } -// vim:set et sw=4 sts=4 ts=4 +// vim:set et sw=4 sts=4 ts=4 enc=utf-8: ?> -- 2.1.4