Skip to content

Commit

Permalink
Fixes too strict encoding in json files
Browse files Browse the repository at this point in the history
  • Loading branch information
RainOrigami committed Oct 2, 2023
1 parent 287074b commit 56cdfcb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion BattleBitAPIRunner/BattleBitAPIRunner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyVersion>1.1.0</AssemblyVersion>
<AssemblyVersion>1.1.1</AssemblyVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
</PropertyGroup>

Expand Down
4 changes: 4 additions & 0 deletions BattleBitAPIRunner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
using System.Text.Encodings.Web;
using System.Text.Json;

namespace BattleBitAPIRunner
Expand Down Expand Up @@ -551,6 +552,7 @@ private void ModuleConfiguration_OnSavingRequest(object? sender, BattleBitModule
{
File.WriteAllText(filePath, JsonSerializer.Serialize(configurationValue, configurationValue.GetType(), new JsonSerializerOptions()
{
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
WriteIndented = true
}));
}
Expand Down Expand Up @@ -598,6 +600,7 @@ private void ModuleConfiguration_OnLoadingRequest(object? sender, BattleBitModul
{
File.WriteAllText(filePath, JsonSerializer.Serialize(configurationValue, configurationValue!.GetType(), new JsonSerializerOptions()
{
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
WriteIndented = true
}));
}
Expand Down Expand Up @@ -629,6 +632,7 @@ private void loadConfiguration()
{
File.WriteAllText("appsettings.json", JsonSerializer.Serialize(this.configuration, new JsonSerializerOptions()
{
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
WriteIndented = true
}));
}
Expand Down

0 comments on commit 56cdfcb

Please sign in to comment.