From 9e115562dc425fb09362d7fede65c6c4f4d7cdc5 Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Tue, 11 Mar 2025 21:37:20 +0200 Subject: [PATCH] Use `WebUtility.UrlEncode` instead of `Uri.EscapeDataString` --- DiscordChatExporter.Core/Utils/Url.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DiscordChatExporter.Core/Utils/Url.cs b/DiscordChatExporter.Core/Utils/Url.cs index 9ccbd30d..2ccf93be 100644 --- a/DiscordChatExporter.Core/Utils/Url.cs +++ b/DiscordChatExporter.Core/Utils/Url.cs @@ -1,4 +1,4 @@ -using System; +using System.Net; using System.Text; namespace DiscordChatExporter.Core.Utils; @@ -18,12 +18,12 @@ public static class Url var separatorIndex = filePath.IndexOfAny([':', '/', '\\'], position); if (separatorIndex < 0) { - buffer.Append(Uri.EscapeDataString(filePath[position..])); + buffer.Append(WebUtility.UrlEncode(filePath[position..])); break; } // Append the segment - buffer.Append(Uri.EscapeDataString(filePath[position..separatorIndex])); + buffer.Append(WebUtility.UrlEncode(filePath[position..separatorIndex])); // Append the separator buffer.Append(