Index: DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.Io/MStabDamXmlSerializer.cs =================================================================== diff -u -r3115 -r3149 --- DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.Io/MStabDamXmlSerializer.cs (.../MStabDamXmlSerializer.cs) (revision 3115) +++ DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.Io/MStabDamXmlSerializer.cs (.../MStabDamXmlSerializer.cs) (revision 3149) @@ -75,7 +75,7 @@ { tnsPrefixDamMStabDoc.tnsPrefixFileIdentification = CreateFileIdentification(); XmlSerializer xmlSerializer = new XmlSerializer(typeof(tnsPrefixDamMStabDoc)); - TextWriter writer = new StringWriter(); + TextWriter writer = new ExtentedStringWriter(new StringBuilder(), Encoding.UTF8); xmlSerializer.Serialize(writer, tnsPrefixDamMStabDoc); string xmlString = writer.ToString(); xmlString = PreProcessPrefixes(xmlString); @@ -123,7 +123,7 @@ } tnsPrefixDamMStabDocFileIdentification.Application = hostAssembly.GetName().Name; tnsPrefixDamMStabDocFileIdentification.Version = hostAssembly.GetName().Version.ToString(); - tnsPrefixDamMStabDocFileIdentification.Created = DateTime.Now.ToShortDateString() + " "+ DateTime.Now.ToShortTimeString(); + tnsPrefixDamMStabDocFileIdentification.Created = DateTime.Now.ToString("yyyy-MM-dd") + "T"+ DateTime.Now.ToString("HH:MM:s") + "Z"; tnsPrefixDamMStabDocFileIdentification.Company = "Deltares"; return tnsPrefixDamMStabDocFileIdentification; } Index: DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.StiFileCreator.Tests/StiFileCreatorTests.cs =================================================================== diff -u -r3147 -r3149 --- DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.StiFileCreator.Tests/StiFileCreatorTests.cs (.../StiFileCreatorTests.cs) (revision 3147) +++ DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.StiFileCreator.Tests/StiFileCreatorTests.cs (.../StiFileCreatorTests.cs) (revision 3149) @@ -55,7 +55,7 @@ // Then Exception Is Thrown Throws.TypeOf().With.Message.EqualTo( - "Value cannot be null." + Environment.NewLine + "Parameter name: StiFileCreatorInput")); + "Value cannot be null." + Environment.NewLine + "Parameter name: stiFileCreatorInput")); } [Test] Index: DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.Io/Deltares.LayerOnSlopeTool.Io.csproj =================================================================== diff -u -r3138 -r3149 --- DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.Io/Deltares.LayerOnSlopeTool.Io.csproj (.../Deltares.LayerOnSlopeTool.Io.csproj) (revision 3138) +++ DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.Io/Deltares.LayerOnSlopeTool.Io.csproj (.../Deltares.LayerOnSlopeTool.Io.csproj) (revision 3149) @@ -45,6 +45,7 @@ + Index: DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.Io/ExtendedStringWriter.cs =================================================================== diff -u --- DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.Io/ExtendedStringWriter.cs (revision 0) +++ DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.Io/ExtendedStringWriter.cs (revision 3149) @@ -0,0 +1,49 @@ +// Copyright (C) Stichting Deltares 2020. All rights reserved. +// +// This file is part of the Dam Engine. +// +// The Dam Engine is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.IO; +using System.Text; + +namespace Deltares.LayerOnSlopeTool.Io +{ + /// Extended stringwriter + /// + public sealed class ExtentedStringWriter : StringWriter + { + private readonly Encoding stringWriterEncoding; + /// Initializes a new instance of the class. + /// The builder. + /// The desired encoding. + public ExtentedStringWriter(StringBuilder builder, Encoding desiredEncoding) + : base(builder) + { + this.stringWriterEncoding = desiredEncoding; + } + + public override Encoding Encoding + { + get + { + return this.stringWriterEncoding; + } + } + } +} \ No newline at end of file Index: DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.StiFileCreator/StiFileCreator.cs =================================================================== diff -u -r3147 -r3149 --- DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.StiFileCreator/StiFileCreator.cs (.../StiFileCreator.cs) (revision 3147) +++ DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.StiFileCreator/StiFileCreator.cs (.../StiFileCreator.cs) (revision 3149) @@ -40,7 +40,8 @@ IoMStabDamDoc ioMStabDamDoc = CreateMStabDamDocFromInput(stiFileCreatorInput); tnsPrefixDamMStabDoc xmlDamMStabDoc = FillXmlDamMStabDocFromIo.FillXmlDamMStabDoc(ioMStabDamDoc); string xmlString = MStabDamXmlSerializer.SaveDamMStabDocAsXmlString(xmlDamMStabDoc); - File.WriteAllText(stiFileCreatorInput.OutputFilename + ".xml", xmlString, Encoding.Unicode); + var length = xmlString.Length; + File.WriteAllText(stiFileCreatorInput.OutputFilename + ".xml", xmlString, Encoding.ASCII); int result = mStabDAMInterface.CreateProjectFile(xmlString); if (result != 0) {