Skip to content

Commit

Permalink
Put the addition of the encoding in an empty constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Víctor Muñoz Molina committed Nov 18, 2024
1 parent d2bc20c commit ed829dd
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ namespace Encamina.Enmarcha.SemanticKernel.Connectors.Document.Connectors;
/// </summary>
public class DocDocumentConnector : IEnmarchaDocumentConnector
{
/// <summary>
/// Initializes a new instance of the <see cref="DocDocumentConnector"/> class.
/// </summary>
public DocDocumentConnector()
{
// Register the code pages encoding provider for the .doc files
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
}

/// <inheritdoc/>
public IReadOnlyList<string> CompatibleFileFormats => [".DOC"];

Expand All @@ -20,9 +29,6 @@ public virtual string ReadText(Stream stream)
{
Guard.IsNotNull(stream);

// Register the code pages encoding provider for the .doc files
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

var document = new HWPFDocument(stream);

var extractor = new WordExtractor(document);
Expand Down

0 comments on commit ed829dd

Please sign in to comment.