Skip to content

Commit 9d38618

Browse files
committed
Changed encoding for the AppInfo.xml file to UTF-8, because installs were failing when you're trying to include the .dmapp package in another package
1 parent 8f37058 commit 9d38618

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

Low Code App Editor_1/Extensions.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
using System.Linq;
88
using System.Xml;
99
using System.Xml.Serialization;
10-
using Newtonsoft.Json.Linq;
10+
11+
using Low_Code_App_Editor_1.Xml;
12+
13+
using Newtonsoft.Json.Linq;
1114

1215
public static class Extensions
1316
{
@@ -107,7 +110,7 @@ public static class XmlConvert
107110
public static string SerializeObject<T>(T obj)
108111
{
109112
XmlSerializer serializer = new XmlSerializer(typeof(T));
110-
using (var sww = new StringWriter())
113+
using (var sww = new StringWriterEncoded())
111114
{
112115
using (XmlWriter writer = new XmlTextWriter(sww) { Formatting = System.Xml.Formatting.Indented })
113116
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
namespace Low_Code_App_Editor_1.Xml
2+
{
3+
using System.IO;
4+
using System.Text;
5+
6+
/// <summary>
7+
/// A StringWriter where you can specify the encoding.
8+
/// </summary>
9+
public sealed class StringWriterEncoded : StringWriter
10+
{
11+
private readonly Encoding encoding;
12+
13+
/// <summary>
14+
/// Initializes a new instance of the <see cref="StringWriterEncoded"/> class, with UTF-8 as encoding.
15+
/// </summary>
16+
public StringWriterEncoded() : this(Encoding.UTF8) { }
17+
18+
/// <summary>
19+
/// Initializes a new instance of the <see cref="StringWriterEncoded"/> class, with the specified encoding.
20+
/// </summary>
21+
/// <param name="encoding"></param>
22+
public StringWriterEncoded(Encoding encoding)
23+
{
24+
this.encoding = encoding;
25+
}
26+
27+
/// <inheritdoc/>
28+
public override Encoding Encoding => encoding;
29+
}
30+
}

0 commit comments

Comments
 (0)