Skip to content

[main] [bug] Change default encoding type to MsDos #920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,21 @@ codeunit 8906 "Email Editor"
UploadAttachment(EmailMessageImpl, FileName, Instream);
end;

procedure UploadAttachment(EmailMessageImpl: Codeunit "Email Message Impl."; SingleFile: FileUpload)
begin
// Default to MS-DOS encoding to keep consistent with the old behavior
UploadAttachment(EmailMessageImpl, SingleFile, TextEncoding::MSDos);
end;

procedure UploadAttachment(EmailMessageImpl: Codeunit "Email Message Impl."; SingleFile: FileUpload; EncodeType: TextEncoding)
var
TempInStream: InStream;
begin
SingleFile.CreateInStream(TempInStream, EncodeType);
if SingleFile.FileName <> '' then
UploadAttachment(EmailMessageImpl, SingleFile.FileName, TempInStream);
end;

procedure UploadAttachment(EmailMessageImpl: Codeunit "Email Message Impl."; FileName: Text; Instream: InStream)
var
AttachmentName, ContentType : Text[250];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,11 @@ page 8889 "Email Attachments"
trigger OnAction(files: List of [FileUpload])
var
EmailEditor: Codeunit "Email Editor";
TempInStream: InStream;
SingleFile: FileUpload;
begin
foreach SingleFile in files do begin
SingleFile.CreateInStream(TempInStream, TextEncoding::UTF8);
if SingleFile.FileName <> '' then
EmailEditor.UploadAttachment(EmailMessageImpl, SingleFile.FileName, TempInStream);
end;
foreach SingleFile in files do
EmailEditor.UploadAttachment(EmailMessageImpl, SingleFile);

UpdateDeleteActionEnablement();
end;
}
Expand Down
Loading