diff --git a/ZUGFeRD/InvoiceDescriptor1Writer.cs b/ZUGFeRD/InvoiceDescriptor1Writer.cs index 19bb68b..a06942c 100644 --- a/ZUGFeRD/InvoiceDescriptor1Writer.cs +++ b/ZUGFeRD/InvoiceDescriptor1Writer.cs @@ -21,8 +21,6 @@ using System.IO; using System.Linq; using System.Text; -using System.Xml; - namespace s2industries.ZUGFeRD { @@ -61,7 +59,7 @@ public override void Save(InvoiceDescriptor descriptor, Stream stream, ZUGFeRDFo long streamPosition = stream.Position; this.Descriptor = descriptor; - this.Writer = new ProfileAwareXmlTextWriter(stream, Encoding.UTF8, descriptor.Profile); + this.Writer = new ProfileAwareXmlTextWriter(stream, descriptor.Profile); this.Writer.SetNamespaces(new Dictionary() { { "xsi", "http://www.w3.org/2001/XMLSchema-instance" }, diff --git a/ZUGFeRD/InvoiceDescriptor20Writer.cs b/ZUGFeRD/InvoiceDescriptor20Writer.cs index 69faed2..46d1e34 100644 --- a/ZUGFeRD/InvoiceDescriptor20Writer.cs +++ b/ZUGFeRD/InvoiceDescriptor20Writer.cs @@ -18,13 +18,9 @@ */ using System; using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Linq; -using System.Security.Cryptography; using System.Text; -using System.Xml; - namespace s2industries.ZUGFeRD { @@ -57,7 +53,7 @@ public override void Save(InvoiceDescriptor descriptor, Stream stream, ZUGFeRDFo long streamPosition = stream.Position; this.Descriptor = descriptor; - this.Writer = new ProfileAwareXmlTextWriter(stream, Encoding.UTF8, descriptor.Profile); + this.Writer = new ProfileAwareXmlTextWriter(stream, descriptor.Profile); this.Writer.SetNamespaces(new Dictionary() { { "a", "urn:un:unece:uncefact:data:standard:QualifiedDataType:100" }, diff --git a/ZUGFeRD/InvoiceDescriptor22UBLWriter.cs b/ZUGFeRD/InvoiceDescriptor22UBLWriter.cs index de09da1..824e9a6 100644 --- a/ZUGFeRD/InvoiceDescriptor22UBLWriter.cs +++ b/ZUGFeRD/InvoiceDescriptor22UBLWriter.cs @@ -21,7 +21,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; namespace s2industries.ZUGFeRD { @@ -44,7 +43,7 @@ public override void Save(InvoiceDescriptor descriptor, Stream stream, ZUGFeRDFo long streamPosition = stream.Position; this.Descriptor = descriptor; - this.Writer = new ProfileAwareXmlTextWriter(stream, Encoding.UTF8, descriptor.Profile); + this.Writer = new ProfileAwareXmlTextWriter(stream, descriptor.Profile); Dictionary _namespaces = new Dictionary() { { "cac", "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" }, diff --git a/ZUGFeRD/InvoiceDescriptor23CIIWriter.cs b/ZUGFeRD/InvoiceDescriptor23CIIWriter.cs index 06b8d5e..8de3947 100644 --- a/ZUGFeRD/InvoiceDescriptor23CIIWriter.cs +++ b/ZUGFeRD/InvoiceDescriptor23CIIWriter.cs @@ -21,8 +21,6 @@ using System.IO; using System.Linq; using System.Text; -using System.Xml; - namespace s2industries.ZUGFeRD { @@ -52,7 +50,7 @@ public override void Save(InvoiceDescriptor descriptor, Stream stream, ZUGFeRDFo long streamPosition = stream.Position; this.Descriptor = descriptor; - this.Writer = new ProfileAwareXmlTextWriter(stream, Encoding.UTF8, descriptor.Profile); + this.Writer = new ProfileAwareXmlTextWriter(stream, descriptor.Profile); this.Writer.SetNamespaces(new Dictionary() { { "a", "urn:un:unece:uncefact:data:standard:QualifiedDataType:100" }, diff --git a/ZUGFeRD/ProfileAwareXmlTextWriter.cs b/ZUGFeRD/ProfileAwareXmlTextWriter.cs index 6cde551..c480ee4 100644 --- a/ZUGFeRD/ProfileAwareXmlTextWriter.cs +++ b/ZUGFeRD/ProfileAwareXmlTextWriter.cs @@ -59,11 +59,11 @@ public ProfileAwareXmlTextWriter(string filename, System.Text.Encoding encoding, } - public ProfileAwareXmlTextWriter(System.IO.Stream w, System.Text.Encoding encoding, Profile profile) + public ProfileAwareXmlTextWriter(System.IO.Stream w, Profile profile) { this.TextWriter = XmlWriter.Create(w, new XmlWriterSettings() { - Encoding = encoding, + Encoding = new UTF8Encoding(false), Indent = true }); this.CurrentProfile = profile;