Conversion caractères utf-8 vers français

Contenu du snippet

En ASP (pas en ASP .net), je n'ai pas trouvé de fonction de transformation des caractères UTF-8 en ISO français.
Je me suis donc créé une fonction basique de remplacement.
Je la mets là car elle peut reservir, soit à moi, soit à d'autres.
Si certains veulent la compléter, n'hésitez pas !

Source / Exemple :


Function Utf8Iso(vsStr)

Dim strTemp

	strTemp = vsStr
	
	strTemp = Replace(strTemp,"ç","ç")
	strTemp = Replace(strTemp,"ä§","ç")
	strTemp = Replace(strTemp,"é","é")
	strTemp = Replace(strTemp,"ä©","é")
	strTemp = Replace(strTemp,"è","è")
	strTemp = Replace(strTemp,"ä¨","è")
	strTemp = Replace(strTemp,"ê","ê")
	strTemp = Replace(strTemp,"äª","ê")
	strTemp = Replace(strTemp,"ë","ë")	
	strTemp = Replace(strTemp,"ä«","ë")	
	strTemp = Replace(strTemp,"Ã?","Ê")
	strTemp = Replace(strTemp,"ä?","Ê")
	strTemp = Replace(strTemp,"Ã?","Ë")
	strTemp = Replace(strTemp,"ä?","Ë")
	strTemp = Replace(strTemp,"î","î")
	strTemp = Replace(strTemp,"ä®","î")
	strTemp = Replace(strTemp,"ï","ï")
	strTemp = Replace(strTemp,"ä¯","ï")
	strTemp = Replace(strTemp,"ì","ì")
	strTemp = Replace(strTemp,"Ã?","Î")
	strTemp = Replace(strTemp,"ä?","Î")
	strTemp = Replace(strTemp,"ò","ò")	
	strTemp = Replace(strTemp,"ä²","ò")	
	strTemp = Replace(strTemp,"ô","ô")
	strTemp = Replace(strTemp,"ä´","ô")
	strTemp = Replace(strTemp,"ö","ö")	
	strTemp = Replace(strTemp,"ä¶","ö")	
	strTemp = Replace(strTemp,"õ","õ")
	strTemp = Replace(strTemp,"ó","ó")
	strTemp = Replace(strTemp,"ø","ø")
	strTemp = Replace(strTemp,"äµ","õ")
	strTemp = Replace(strTemp,"ä³","ó")
	strTemp = Replace(strTemp,"ä¸","ø")
	strTemp = Replace(strTemp,"Ã?","Ô")
	strTemp = Replace(strTemp,"ä?","Ô")
	strTemp = Replace(strTemp,"Ã?","Ö")	
	strTemp = Replace(strTemp,"ä?","Ö")	
	strTemp = Replace(strTemp,"Ã ","à")
	strTemp = Replace(strTemp,"ä ","à")
	strTemp = Replace(strTemp,"â","â")
	strTemp = Replace(strTemp,"ä¢","â")
	strTemp = Replace(strTemp,"ä","ä")	
	strTemp = Replace(strTemp,"ä¤","ä")
	strTemp = Replace(strTemp,"Ã¥","å")
	strTemp = Replace(strTemp,"ä¥","å")
	strTemp = Replace(strTemp,"Ã?","Â")
	strTemp = Replace(strTemp,"ä?","Â")
	strTemp = Replace(strTemp,"Ã?","Ä")	
	strTemp = Replace(strTemp,"ä?","Ä")	
	strTemp = Replace(strTemp,"ù","u")	
	strTemp = Replace(strTemp,"û","û")
	strTemp = Replace(strTemp,"ü","ü")
	strTemp = Replace(strTemp,"ä¼","ü")
	strTemp = Replace(strTemp,"Ã?","Û")
	strTemp = Replace(strTemp,"Ã?","Ü")
	strTemp = Replace(strTemp,"ä¹","u")	
	strTemp = Replace(strTemp,"ä»","û")
	strTemp = Replace(strTemp,"ä¼","ü")
	strTemp = Replace(strTemp,"ä¼","ü")
	strTemp = Replace(strTemp,"ä?","Û")
	strTemp = Replace(strTemp,"ä?","Ü")
	strTemp = Replace(strTemp,"ò","ñ")
	strTemp = Replace(strTemp,"ñ","ñ")
	
	Utf8Iso = strTemp

End Function

A voir également