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

@ -21,6 +21,7 @@ using System.IO;
using System.Net;
using System.Text;
using Server.Guilds;
using Server.Text;
namespace Server
{
@ -37,7 +38,7 @@ namespace Server
public BufferReader(byte[] buffer)
{
_buffer = buffer;
_encoding = Utility.UTF8;
_encoding = TextEncoding.UTF8;
}
public void SwapBuffers(byte[] newBuffer, out byte[] oldBuffer)

View file

@ -20,6 +20,7 @@ using System.IO;
using System.Net;
using System.Runtime.CompilerServices;
using System.Text;
using Server.Text;
namespace Server
{
@ -56,7 +57,7 @@ namespace Server
public BufferWriter(byte[] buffer, bool prefixStr)
{
m_PrefixStrings = prefixStr;
m_Encoding = Utility.UTF8;
m_Encoding = TextEncoding.UTF8;
_buffer = buffer;
}
@ -67,7 +68,7 @@ namespace Server
public BufferWriter(int count, bool prefixStr)
{
m_PrefixStrings = prefixStr;
m_Encoding = Utility.UTF8;
m_Encoding = TextEncoding.UTF8;
_buffer = GC.AllocateUninitializedArray<byte>(count < 1 ? BufferSize : count);
}