Naviguation dans :  Perl  JavaScript  Détail  - load.cgi?Appel=baseAdmin
 présentée :  par cas d'appel   par traitements 
Retour à l'accueil
  
     
 Requêtes 

 load – Admin 

 baseAdmin 

Requêtes de Ça-déménage.com
Accès professionnel
Chargement de la base
 submit | Finer | Errer | Execer | fromClient | toDBase | fromDBase | toClient 
  
 
 Bibliothèque CaD 

 Base 

 Ident. contrôlée 

Bibliothèque de Ça-déménage.com
Accès aux bases
Gestion de l'expiration de l'identification
 
  
  
 Bibliothèque 

 Mail 

 parseMail 

Bibliothèque standard
Divers utilitaires de gestion des mails
Mise en forme standard du sujet d'un mail
  


 parseMail  Mise en forme standard du sujet d'un mail
Syntaxe parseMail(x)
Paramètres 
nom  type  Description 
 IN Sujet à mettre en forme
retourne  OUT Sujet mis en forme
Fonctions util. Néant


Code Perl 

sub parseMail {local($x) = @_; 
 local($x1,$x2,$i,$k,$k1,$k2); 
 $x1 = "";
for($i=0;$i<length($x);$i++) {
 if (substr($x,$i,1)=~/[a-zA-Z0-9]/) {$x1 .= substr($x,$i,1); next}
 if (substr($x,$i,1) eq " ") {$x1 .= "_"; next}
 $k = ord(substr($x,$i,1));
 $k1 = $k%16; $k2 = ($k-$k1)/16;
 $x1 .= "=".(($k2<10)?$k2.'':chr(65+$k2-10)).(($k1<10)?$k1.'':chr(65+$k1-10))
}
 $x2 = "";
while(length($x1)>60) {
 $k = 60; if (substr($x1,59,1) eq "=") {$k = 59} elsif (substr($x1,58,1) eq "=") {$k = 58}
 $x2 .= "=?iso-8859-1?q?".substr($x1,0,$k)."?= "; $x1 = substr($x1,$k);
}
 $x2 .= "=?iso-8859-1?q?".$x1."?=";
 return $x2;
}
Code JavaScript 

function parseMail(x) { 
 var x1,x2,i,k,k1,k2; 
 x1 = "";
for(i=0;i<x.length;i++) {
 if (x.substr(i,1).match(/[a-zA-Z0-9]/)) {x1 += x.substr(i,1); continue}
 if (x.substr(i,1)==" ") {x1 += "_"; continue}
 k = x.charCodeAt(i);
 k1 = k%16; k2 = (k-k1)/16;
 x1 += "="+((k2<10)?k2.toString():String.fromCharCode(65+k2-10))+((k1<10)?k1.toString():String.fromCharCode(65+k1-10))
}
 x2 = "";
while(x1.length>60) {
 k = 60; if (x1.substr(59,1)=="=") {k = 59} else if (x1.substr(58,1)=="=") {k = 58}
 x2 += "=?iso-8859-1?q?"+x1.substr(0,k)+"?= "; x1 = x1.substr(k);
}
 x2 += "=?iso-8859-1?q?"+x1+"?=";
 return x2;
}