DefaultEcs
DefaultEcs copied to clipboard
TextSerializer is not culture invariant
On my machine the Serialize_Should_serialize_World
and Serialize_Should_serialize_Entities
tests fail as the TextSerializer reads values with an invariant culture but written with the current culture.
It can be fixed by using a thin wrapper over StreamWriter
overriding the FormatProvider
property (in the StreamWriterWrapper
class):
internal sealed class InvariantCultureStreamWriter : StreamWriter
{
public InvariantCultureStreamWriter(Stream stream, Encoding encoding, int bufferSize, bool leaveOpen) : base(stream, encoding, bufferSize, leaveOpen)
{
}
public override IFormatProvider FormatProvider => global::System.Globalization.CultureInfo.InvariantCulture;
}
arg good catch >_< thanks for reporting it, It's even there in all the Parse
call here https://github.com/Doraku/DefaultEcs/blob/master/source/DefaultEcs/Internal/Serialization/TextSerializer/Converter.cs#L118
I should have smell something fishy that the WriteLine
didn't take one.