Skip to content

TextSerializer is not culture invariant #170

Closed
@Helco

Description

@Helco

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions