Hi,
It should be simple, but despite all my searching I can't seem to find a clear answer...
I'm trying to write a small function that converts a string, one character at a time, according to two other strings serving as keys/values.
For example, the string "AAC" should become "113" using "ABCD" as keys and "1234" as values.
In the good old days I'd write something like this (simplified):
function conv(const src, keys, values : string) : string;
var
j : integer;
begin
Result := src;
for j := 1 to Length(src) do
Result[j] := values[Pos(src[j], keys)];
end;
Now, with all the unicode and widestrings, this simply doesn't work for strings with, in my case, Hebrew characters. The [] reference gives access only to 8-bit Chars.
How can I rewrite the above function to accommodate all kinds of strings/characters? thanks!