@@ -204,7 +204,7 @@ DEFINE_INTERNAL_CALL(bool) EditorInternal_SaveJsonAsset(MString* outputPathObj,
|
||||
FileSystem::NormalizePath(outputPath);
|
||||
|
||||
const StringView dataObjChars = MCore::String::GetChars(dataObj);
|
||||
const StringAsANSI<> data(dataObjChars.Get(), dataObjChars.Length());
|
||||
const StringAsUTF8<> data(dataObjChars.Get(), dataObjChars.Length());
|
||||
const StringAnsiView dataAnsi(data.Get(), data.Length());
|
||||
|
||||
const StringView dataTypeNameObjChars = MCore::String::GetChars(dataTypeNameObj);
|
||||
|
||||
@@ -15,6 +15,17 @@ using Newtonsoft.Json.Serialization;
|
||||
|
||||
namespace FlaxEngine.Json
|
||||
{
|
||||
sealed class StringWriterWithEncoding : StringWriter
|
||||
{
|
||||
public override Encoding Encoding { get; }
|
||||
|
||||
public StringWriterWithEncoding(System.Text.StringBuilder sb, IFormatProvider formatProvider, Encoding encoding)
|
||||
: base(sb, formatProvider)
|
||||
{
|
||||
Encoding = encoding;
|
||||
}
|
||||
}
|
||||
|
||||
partial class JsonSerializer
|
||||
{
|
||||
internal class SerializerCache
|
||||
@@ -37,7 +48,7 @@ namespace FlaxEngine.Json
|
||||
{
|
||||
IsManagedOnly = isManagedOnly;
|
||||
StringBuilder = new StringBuilder(256);
|
||||
StringWriter = new StringWriter(StringBuilder, CultureInfo.InvariantCulture);
|
||||
StringWriter = new StringWriterWithEncoding(StringBuilder, CultureInfo.InvariantCulture, Encoding.UTF8);
|
||||
MemoryStream = new UnmanagedMemoryStream((byte*)0, 0);
|
||||
|
||||
#if FLAX_EDITOR
|
||||
|
||||
Reference in New Issue
Block a user