NotSupportedException: No data is available for encoding 1252 exception on loading MSG file (C# .NET Core)

GIVEN

  • .NET Core 2.2 project and Aspose.Email v19.4.0.
  • an email (.msg file) in a non-UTF8 encoding (e.g. DOS-era win-1252)

WHEN calling
var mailMessage = MailMessage.Load(stream);
where the stream points to the non-UTF8 encoded email.

THEN it throws an exception:

   System.NotSupportedException. Message=No data is available for encoding 1252. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
      Source=Aspose.Email`
      StackTrace:
       at  .(Object )
       at  .()
       at  .(Object , UInt32 )
       at  .()
       at  .(Object[] , Type[] , Type[] , Object[] )
       at ​ .​   (MapiMessage )
       at Aspose.Email.MailMessage.(Stream , MsgLoadOptions )
       at Aspose.Email.MailMessage.(Stream , LoadOptions )
       at 
    MyProject.AsposeDocumentService.GetEmailMetaData(Stream stream) in C:\MyProject\AsposeDocumentService.cs:line 213

Found this SO post c# - System.NotSupportedException: No data is available for encoding 1252 - Stack Overflow, but that solution doesn’t make a difference.

Seems that it’s been fixed in v19.9.
Sorry for the ticket. You can close it

@lawmaster,

It’s good to know things are resolved on your end after use of latest version.