OVH Cloud OVH Cloud

Webclient Encoding

1 réponse
Avatar
Dimitri TRAVAILLOUX
Bonjour

Suite à un Webclient du style
Stream data = this.wb.OpenRead (http://fr.news.yahoo.com/303/);

J'aimerais afficher correctement la chaine retournée en UTF8, comment fait
on en C# ?
merci

1 réponse

Avatar
Osman MALIK [MS]
Bonjour,

Pour lire le contenu du stream, il faut créer un StreamReader avec un
encodage en UTF8.
Vous trouverez un exemple répondant à votre besoin ici :
http://www.ondotnet.com/pub/a/dotnet/excerpt/csharpckbk_chap01/index1.html

Cordialement,

Osman MALIK
Microsoft France


"Dimitri TRAVAILLOUX" wrote in message
news:
Bonjour

Suite à un Webclient du style
Stream data = this.wb.OpenRead (http://fr.news.yahoo.com/303/);

J'aimerais afficher correctement la chaine retournée en UTF8, comment fait
on en C# ?
merci