fix(core): Streamlines text encoding (#407)
- [X] Streamlines text encoding
This commit is contained in:
parent
5631c1da6d
commit
211c2ba8ee
25 changed files with 274 additions and 137 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Server.Text;
|
||||
|
||||
namespace Server.Tests
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Server.Text;
|
||||
using Xunit;
|
||||
|
||||
namespace Server.Tests
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue