summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-08-09 10:11:34 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2010-08-09 10:11:34 -0700
commit9cc2e42c9d4cdb2811822fac80928a3dc5687822 (patch)
tree24be7f500527f671ed46346b2112f7f9a8c477e8 /src
parent226b0536565a3377b2bf106373f66d55109c66f9 (diff)
downloadDotNetOpenAuth-9cc2e42c9d4cdb2811822fac80928a3dc5687822.zip
DotNetOpenAuth-9cc2e42c9d4cdb2811822fac80928a3dc5687822.tar.gz
DotNetOpenAuth-9cc2e42c9d4cdb2811822fac80928a3dc5687822.tar.bz2
Fixed UTF8 preambles in reporting.
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth/Reporting.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/DotNetOpenAuth/Reporting.cs b/src/DotNetOpenAuth/Reporting.cs
index 612845f..9f104fe 100644
--- a/src/DotNetOpenAuth/Reporting.cs
+++ b/src/DotNetOpenAuth/Reporting.cs
@@ -107,6 +107,11 @@ namespace DotNetOpenAuth {
private static DateTime lastPublished = DateTime.Now;
/// <summary>
+ /// A UTF8 encoder that doesn't emit the preamble. Used for mid-stream writers.
+ /// </summary>
+ private static readonly Encoding Utf8NoPreamble = new UTF8Encoding(false);
+
+ /// <summary>
/// Initializes static members of the <see cref="Reporting"/> class.
/// </summary>
[SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline", Justification = "We do more than field initialization here.")]
@@ -665,7 +670,7 @@ namespace DotNetOpenAuth {
this.memorySet.Add(this.reader.ReadLine());
}
- this.writer = new StreamWriter(this.fileStream, Encoding.UTF8);
+ this.writer = new StreamWriter(this.fileStream, Utf8NoPreamble);
this.lastFlushed = DateTime.Now;
}
@@ -818,7 +823,7 @@ namespace DotNetOpenAuth {
}
}
- this.writer = new StreamWriter(this.fileStream, Encoding.UTF8);
+ this.writer = new StreamWriter(this.fileStream, Utf8NoPreamble);
this.lastFlushed = DateTime.Now;
}