From 9d8a34264f24a77eb443d43dfd4a1a6f3d2a9e3d Mon Sep 17 00:00:00 2001 From: maxisoft Date: Mon, 9 Sep 2024 14:19:45 +0200 Subject: [PATCH] Use StreamReader without specifying UTF8 encoding (as it's the default already) to fix #91 --- ASFFreeGames/HttpClientSimple/SimpleHttpClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ASFFreeGames/HttpClientSimple/SimpleHttpClient.cs b/ASFFreeGames/HttpClientSimple/SimpleHttpClient.cs index 2d67380..3a0186b 100644 --- a/ASFFreeGames/HttpClientSimple/SimpleHttpClient.cs +++ b/ASFFreeGames/HttpClientSimple/SimpleHttpClient.cs @@ -146,7 +146,7 @@ public sealed class HttpStreamResponse(HttpResponseMessage response, Stream? str public bool HasValidStream => stream is not null && (!EmptyStreamLazy.IsValueCreated || !ReferenceEquals(EmptyStreamLazy.Value, Stream)); public async Task ReadAsStringAsync(CancellationToken cancellationToken) { - using StreamReader reader = new(Stream, Encoding.UTF8); + using StreamReader reader = new(Stream); // assume the encoding is UTF8, cannot be specified as per issue #91 return await reader.ReadToEndAsync(cancellationToken).ConfigureAwait(false); }