Voilà une fonction convertir_special() que j'utilise comme ceci: textbox5.text=convertir_special(titre), titre étant une chaine vous vous en doutez.
Lors que je l'exécute, j'ai une exception de type :Object reference not set to an instance of an object. sur la première ligne de ma fonction...au premier remplacement...:-( need help les gens merci' à l'avance...
private string convertir_special(string text)
{
text = text.Replace("&", "&");
text = text.Replace("¡", "¡");
text = text.Replace("¢", "¢");
text = text.Replace("£", "£");
text = text.Replace("?", "¤");
text = text.Replace("¥", "¥");
text = text.Replace("|", "¦");
text = text.Replace("§", "§");
text = text.Replace("?", "¨");
text = text.Replace("©", "©");
text = text.Replace("ª", "ª");
text = text.Replace("«", "«");
text = text.Replace("¬", "¬");
text = text.Replace("", "­");
text = text.Replace("®", "®");
text = text.Replace("¯", "¯");
text = text.Replace("°", "°");
text = text.Replace("±", "±");
text = text.Replace("²", "²");
text = text.Replace("³", "³");
text = text.Replace("?", "´");
text = text.Replace("µ", "µ");
text = text.Replace("¶", "¶");
text = text.Replace("·", "·");
text = text.Replace("?", "¸");
text = text.Replace("¹", "¹");
text = text.Replace("º", "º");
text = text.Replace("»", "»");
text = text.Replace("?", "¼");
text = text.Replace("?", "½");
text = text.Replace("?", "¾");
text = text.Replace("¿", "¿");
text = text.Replace("À", "À");
text = text.Replace("Á", "Á");
text = text.Replace("Â", "Â");
text = text.Replace("Ã", "Ã");
text = text.Replace("Ä", "Ä");
text = text.Replace("Å", "Å");
text = text.Replace("Æ", "Æ");
text = text.Replace("Ç", "Ç");
text = text.Replace("È", "È");
text = text.Replace("É", "É");
text = text.Replace("Ê", "Ê");
text = text.Replace("Ë", "Ë");
text = text.Replace("Ì", "Ì");
text = text.Replace("Í", "Í");
text = text.Replace("Î", "Î");
text = text.Replace("Ï", "Ï");
text = text.Replace("Ð", "Ð");
text = text.Replace("Ñ", "Ñ");
text = text.Replace("Ò", "Ò");
text = text.Replace("Ó", "Ó");
text = text.Replace("Ô", "Ô");
text = text.Replace("Õ", "Õ");
text = text.Replace("Ö", "Ö");
text = text.Replace("×", "×");
text = text.Replace("Ø", "Ø");
text = text.Replace("Ù", "Ù");
text = text.Replace("Ú", "Ú");
text = text.Replace("Û", "Û");
text = text.Replace("Ü", "Ü");
text = text.Replace("Ý", "Ý");
text = text.Replace("Þ", "Þ");
text = text.Replace("ß", "ß");
text = text.Replace("à", "à");
text = text.Replace("á", "á");
text = text.Replace("â", "â");
text = text.Replace("ã", "ã");
text = text.Replace("ä", "ä");
text = text.Replace("å", "å");
text = text.Replace("æ", "æ");
text = text.Replace("ç", "ç");
text = text.Replace("è", "è");
text = text.Replace("é", "é");
text = text.Replace("ê", "ê");
text = text.Replace("ë", "ë");
text = text.Replace("ì", "ì");
text = text.Replace("í", "í");
text = text.Replace("î", "î");
text = text.Replace("ï", "ï");
text = text.Replace("ð", "ð");
text = text.Replace("ñ", "ñ");
text = text.Replace("ò", "ò");
text = text.Replace("ó", "ó");
text = text.Replace("ô", "ô");
text = text.Replace("õ", "õ");
text = text.Replace("ö", "&ö");
text = text.Replace("÷", "&÷");
text = text.Replace("ø", "ø");
text = text.Replace("ù", "ù");
text = text.Replace("ú", "ú");
text = text.Replace("û", "û");
text = text.Replace("ü", "ü");
text = text.Replace("ý", "ý");
text = text.Replace("þ", "þ");
text = text.Replace("ÿ", "ÿ");
// MessageBox.Show(text);
return text;
}
Coding is not a crime!