Closed MichaelPeter closed 2 years ago
Describe the bug .NET Core/.Net5/.Net6 does not support Windows encoding by default. But German outlook seems to use that by default for msg files. This can be fixed by adding a reference to System.Text.Encoding.CodePages and registering the encoding like here: https://stackoverflow.com/questions/50858209/system-notsupportedexception-no-data-is-available-for-
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
Since this library should be able to open all kinds of .msg should this maybe be done already by default? Or add at least a comment in documenation?
To Reproduce call for the attached .msg file
using (var msg = new Storage.Message(stream)) { string bodyHtml = msg.BodyHtml; }
test.mail.with.picture.and.listing.msg.txt
Added with this commit Encoding.RegisterProvider
Describe the bug .NET Core/.Net5/.Net6 does not support Windows encoding by default. But German outlook seems to use that by default for msg files. This can be fixed by adding a reference to System.Text.Encoding.CodePages and registering the encoding like here: https://stackoverflow.com/questions/50858209/system-notsupportedexception-no-data-is-available-for-
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
Since this library should be able to open all kinds of .msg should this maybe be done already by default? Or add at least a comment in documenation?
To Reproduce call for the attached .msg file
test.mail.with.picture.and.listing.msg.txt