Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
feat(httpwebutility): fix using wrong encoding
Browse files Browse the repository at this point in the history
Les réponses du serveur contenant des caractères UTF8 n'était pas traitée correctement (accents qui se transformaient en ?)
  • Loading branch information
NaolShow committed Jan 17, 2022
1 parent 4708c6f commit 238b363
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion UnigeWebUtility/HttpWebUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ public static string GetContent(this HttpWebResponse response) {
// Get the response stream
using Stream stream = response.GetResponseStream();

// Get the encoding from the response
var encoding = Encoding.GetEncoding(response.CharacterSet);

// Convert the stream to a stream reader
using StreamReader reader = new(stream);
using StreamReader reader = new(stream, encoding);

return reader.ReadToEnd();

Expand Down

0 comments on commit 238b363

Please sign in to comment.