title: Why has the textfile's encoding changed from UTF-8 to ANSI (and how to solve this)?
body: <p>I'm sending a .txt file as an attachment from an Android device using Indy.</p>
  
  <p>When I download this, the .txt file's encoding has changed from UTF-8 to ANSI and is displaying it's content in lines next to eachother instead of underneath eachother.</p>
  
  <p>So what have I been doing wrong, and how to solve this?</p>
  
  <p>Functional code used to send the mail:</p>
  
  <pre><code>Body := TStringList.Create;
  IdSMTP := TIdSMTP.Create(nil);
  SSLHandler:= TIdSSLIOHandlerSocketOpenSSL.Create(Form1);
  IdSMTP.IOHandler:= SSLHandler;
  IdSMTP.UseTLS:= utUseExplicitTLS;
  
  IdSMTP.Host := 'smtp.gmail.com';
  IdSMTP.Port := 587;
  IdSMTP.AuthType := satDefault;
  IdSMTP.Username := AppData.MailAddrSender;
  IdSMTP.Password := Appdata.MailPassword;
  
  IdMessage := TIdMessage.Create(nil);
  IdMessage.From.Name := aName;
  IdMessage.From.Address := AppData.MailAddrSender;
  IdMessage.Subject := 'E-mail subject';
  
  PathString := System.IOUtils.TPath.Combine(System.IOUtils.TPath.GetDocumentsPath, (PathString + 'Log.txt'));
  Body.Add('Mail todays log,');
  if FileExists(PathString) then
    TIdAttachmentFile.Create(IdMessage.MessageParts,PathString);
  try
    for I := 0 to Body.Count -1 do
      IdMessage.Body.Add(Body.Strings[I]);
    IdEmailAddressItem := IdMessage.Recipients.Add;
    IdEmailAddressItem.Address := AppData.MailAddrReceiver;
  
    try
      IdSMTP.Connect;
      try
        if IdSMTP.Authenticate then
        IdSMTP.Send(IdMessage);
  
      finally
        IdMessage.Free;
        IdSMTP.Disconnect;
      end;
  
    except
      on E: Exception do
      //exception handling here
    end;
  finally
    IdSMTP.Free;
    SSLHandler.DisposeOf;
    Body.DisposeOf;
  end;
  </code></pre>
  
  <p>Thank you for your time.</p>