j'ai une fenetre c# contenant un formulaire qui peut contenir des
caractères accentués.
je stocke le contenu dans un fichier texte au format html.
<CODE>
/// le flux qui va contenir le code html des images
StringBuilder stringBuilderHtmlImages = new StringBuilder();
StringWriter writerToString = new StringWriter(stringBuilderHtmlImages);
// Le flux vers lequel on va sauver le code html généré
StreamWriter sw = new StreamWriter(m.repertoireHtml + nomPage);
using (StreamReader sr = new StreamReader(Constantes.DIR_APP +
Constantes.DIR_TPL + "page.htm", Encoding.GetEncoding("iso-8859-1") ))
{
String line;
while ((line = sr.ReadLine()) != null)
{
modeleHtml += line;
}
}
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
gabriel
C'est bon, j'ai trouvé : /// Le flux qui va contenir le code html des images StringBuilder template = new StringBuilder(); // The encoding. UnicodeEncoding unicode = new UnicodeEncoding();
// Le fichier de destination string nomFichierDestination = m.repertoireHtml + nomPage; StreamWriter fichierDestination = new StreamWriter(nomFichierDestination, false, unicode);
tout simplement :)
C'est bon, j'ai trouvé :
/// Le flux qui va contenir le code html des images
StringBuilder template = new StringBuilder();
// The encoding.
UnicodeEncoding unicode = new UnicodeEncoding();
// Le fichier de destination
string nomFichierDestination = m.repertoireHtml + nomPage;
StreamWriter fichierDestination = new
StreamWriter(nomFichierDestination, false, unicode);
C'est bon, j'ai trouvé : /// Le flux qui va contenir le code html des images StringBuilder template = new StringBuilder(); // The encoding. UnicodeEncoding unicode = new UnicodeEncoding();
// Le fichier de destination string nomFichierDestination = m.repertoireHtml + nomPage; StreamWriter fichierDestination = new StreamWriter(nomFichierDestination, false, unicode);
tout simplement :)
Ambassadeur Kosh
tu en as un static readonly dans la base fait pour ça ( dans la class System.Text.Encoding ) et il y'a les autres.
genre
using System.Text ;
XmlWriter writer = new XmlTextWriter(@"c:test.xml",Encoding.Unicode) ;
tu en as un static readonly dans la base fait pour ça ( dans la class
System.Text.Encoding )
et il y'a les autres.
genre
using System.Text ;
XmlWriter writer = new XmlTextWriter(@"c:test.xml",Encoding.Unicode) ;