fix(core): Streamlines text encoding (#407)

- [X] Streamlines text encoding
This commit is contained in:
Kamron Batman 2021-01-13 18:56:32 -08:00 committed by GitHub
parent 5631c1da6d
commit 211c2ba8ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 274 additions and 137 deletions

View file

@ -1,4 +1,5 @@
using System;
using Server.Text;
namespace Server.Tests
{

View file

@ -1,4 +1,5 @@
using System.Text;
using Server.Text;
namespace Server.Tests
{
@ -7,9 +8,9 @@ namespace Server.Tests
public static Encoding GetEncoding(string bodyname) =>
bodyname switch
{
"utf-8" => Utility.UTF8,
"utf-16" => Utility.UnicodeLE,
"utf-16BE" => Utility.Unicode,
"utf-8" => TextEncoding.UTF8,
"utf-16" => TextEncoding.UnicodeLE,
"utf-16BE" => TextEncoding.Unicode,
_ => Encoding.ASCII
};
}

View file

@ -1,4 +1,5 @@
using System;
using Server.Text;
using Xunit;
namespace Server.Tests