S := Memo1.Lines.Text; if S <> '' then begin OemToChar(@S[1], @S[1]); //здесь ошибочно указал "S1", вместо "S" Memo1.Lines.Text := S; end;