@joebigelow / wix-1 / commits / 5a105b51

Update WixOutput's GetData to use StreamReader.

Sean Hall committed Apr 18, 2020 at 21:15 UTC 5a105b510c5f2a082e5b5ab7ae94adf2491b0416
1 file changed +3 -5
src/WixToolset.Data/WixOutput.cs
+3 -5
@@ -222,14 +222,12 @@ namespace WixToolset.Data
222 {
223 var entry = this.archive.GetEntry(name);
224
225 - var bytes = new byte[entry.Length];
226 -
225 + // Use StreamReader to "swallow" BOM if present.
226 using (var stream = entry.Open())
227 + using (var streamReader = new StreamReader(stream, Encoding.UTF8))
228 {
229 - stream.Read(bytes, 0, bytes.Length);
229 + return streamReader.ReadToEnd();
230 }
231 -
232 - return Encoding.UTF8.GetString(bytes);
231 }
232
233 /// <summary>