diff --git a/BeefLibs/corlib/src/Type.bf b/BeefLibs/corlib/src/Type.bf index bf698466..14ef5228 100644 --- a/BeefLibs/corlib/src/Type.bf +++ b/BeefLibs/corlib/src/Type.bf @@ -1130,7 +1130,10 @@ namespace System.Reflection strBuffer.Append((*(bool*)&mValue) ? "true" : "false"); case typeof(char8), typeof(char16), typeof(char32): strBuffer.Append('\''); - (*(char32*)&mValue).ToString(strBuffer); + var str = (*(char32*)&mValue).ToString(.. scope .()); + let len = str.Length; + String.QuoteString(&str[0], len, str); + strBuffer.Append(str[(len + 1)...^2]); strBuffer.Append('\''); case typeof(uint64), typeof(uint): (*(uint64*)&mValue).ToString(strBuffer); diff --git a/IDE/mintest/minlib/src/System/Type.bf b/IDE/mintest/minlib/src/System/Type.bf index bf698466..14ef5228 100644 --- a/IDE/mintest/minlib/src/System/Type.bf +++ b/IDE/mintest/minlib/src/System/Type.bf @@ -1130,7 +1130,10 @@ namespace System.Reflection strBuffer.Append((*(bool*)&mValue) ? "true" : "false"); case typeof(char8), typeof(char16), typeof(char32): strBuffer.Append('\''); - (*(char32*)&mValue).ToString(strBuffer); + var str = (*(char32*)&mValue).ToString(.. scope .()); + let len = str.Length; + String.QuoteString(&str[0], len, str); + strBuffer.Append(str[(len + 1)...^2]); strBuffer.Append('\''); case typeof(uint64), typeof(uint): (*(uint64*)&mValue).ToString(strBuffer);