Your OemToAnsi
function should look like this:
function OemToAnsi(const Str: AnsiString): AnsiString;
begin
SetLength(Result, Length(Str));
OemToCharA(PAnsiChar(Str), PAnsiChar(Result));
end;
But perhaps you'd be better with
function OemToWide(const Str: AnsiString): string;
begin
SetLength(Result, Length(Str));
OemToChar(PAnsiChar(Str), PChar(Result));
end;
As for your StrToRichText
, that looks more difficult. It clearly only accepts ANSI input. If you want to stick with ANSI then just change the declaration to
function StrToRichText(const Str: AnsiString): AnsiString;
RTF is encoded with 7 bit ASCII. To make that function work with Unicode input you'd need to escape any characters with ordinal >= 128. The escaping is described, for example, on the Wikipedia Rich Text Format page. I'll leave that as an exercise for you!
Before you go much further you need to read Marco Cantù's white paper: Delphi and Unicode.