.NET Idiosyncrasies #1: System.Net.Mail.AlternateView
In the spirit of sharing (and since C# is pretty much all my sorry life revolves around, these days ;o) I will start a new series of articles about oddities I've found in the .NET class library. Here's one of my observations, which probably is more of an actual (albeit benign) bug than an idiosyncrasy:
In my experience, the following approach can introduce encoding errors:
AlternativeView htmlAlternateView =This, however, will circumvent the problem:
new AlternateView(htmlTempFileName, MediaTypeNames.Text.Html);
AlternateView.CreateAlternateViewFromString(File.ReadAllText(htmlTempFileName), Encoding.Default, MediaTypeNames.Text.Html);
[ Post Comment | Read Comments (0) ]
You can syndicate our content with this handy RSS feed.
Content © 2010 Torben K. Jensen. All rights reserved.
This website was made possible by Poseidon.
Content © 2010 Torben K. Jensen. All rights reserved.
This website was made possible by Poseidon.
