anchor.diff:      wordlist.Frame.SaveToFile(wordlist.Frame.Filename);
     end;
   
  -  model.Text := parser.Text;
  -  model.SaveToFile(FileName);
  +  // We use TStringStream instead of TStringList so we don't get
  +  // a BOM on the saved file
  +  stream := TStringStream.Create(parser.Text, TEncoding.UTF8);
  +  try
  +    stream.SaveToFile(FileName);
  +  finally
  +    stream.Free;
  +  end;
   
     editOutPath.Text := (ProjectFile as TmodelTsProjectFile).TargetFilename;   // I4688
   
  
positive.code: function TfrmModelEditor.DoSaveFile: Boolean;
  var
    wordlist: TWordlist;
  begin
    if pages.ActivePage = pageSource then
    begin
  
negative.code: { TfrmModelEditor }
  
  function TfrmModelEditor.DoOpenFile: Boolean;
  var
    model: TStringList;
  begin
    model := TStringList.Create;
    try
      model.DefaultEncoding := TEncoding.UTF8;
      try
        model.LoadFromFile(FileName);
      except
        on E:EEncodingError do
        begin
          try
            model.LoadFromFile(FileName, TEncoding.Default);
          except
            on E:EEncodingError do
            begin
              ShowMessage('Could not load file, does not appear to be a valid encoding.');
              Exit(False);
            end;
          end;
        end;
      end;
      parser := TLexicalModelParser.Create(model.Text);
    finally
      model.Free;
    end;
  
    wordlists := TWordlists.Create;
  
    Inc(FSetup);
  