Category Archives: coding

coding scripting compiling

désaccentuation

désaccentuation

J’oubliais, ce petit script pour “désaccentuer” du texte : utiliser entity_decode,
puisque é s’écrit &+e+acute; on peut récupérer le ‘e’ après le & :
function f_desaccentuation($v_str)

{
//htmlentities pour les accents !: référence devient reference
$str=f_str2utf8($v_str);
$str=f_str2iso(html_entity_decode($str,ENT_NOQUOTES,”UTF-8″));
$str=preg_replace(“/[\xa0-\xbf\xd7\xf7]/”,” “,$str);
$str=htmlentities(f_str2utf8($str),ENT_NOQUOTES,”UTF-8″);
$str=str_replace(” “,” “,$str);
$str=str_replace(“<“,”<“,$str);
$str=str_replace(“>”,”>”,$str);
$str=str_replace(“&”,”&”,$str);
$str=str_replace(“””,'”‘,$str);
$str=str_replace(“‘”,”‘”,$str);
return(preg_replace(“/\&(.)[^\;]*\;/”,”$1″,$str));
}

pas de table de conversion 🙂

half-em and dash in Word : why copy paste command line from MS-WORD with dashes fail

half-em and dash in Word : why copy paste command line from MS-WORD with dashes fail

Word evolves , it replaces dash  by typographic characters the picky way. so dashes.
I was copy pasting from word and bang! :
# keytool -list –v -keystore tomcat.jks
Unrecognized command: –v
it is hidden to non hexadecimal reader
[root@h0l1ice11t conf]# echo "keytool -list –v ..."|od -cx
0000000 k e y t o o l   - l i s t   342 200 
      656b 7479 6f6f 206c 6c2d 7369 2074 80e2
0000020 223 v  
      7693 
fiiiix it …..
* in word, deactivate any automatism
menu file / option / verification / option auto-correction ….
uncheck outrageously
* and now replace – by – [sic]there is an option to type “half-em-dash”
the option : “Plus>>” “special” “half-em-dash”
conclusion : use MD (markdown), not MS