fw is a string which in Delphi 7 is 8 bit ANSI encoded. The cast to PWideChar is thus incorrect. It will treat the 8 bit text as if it were UTF-16 encoded.
If the function you are calling really does receive PWideChar then you need to convert to UTF-16 first. For example like this:
PWideChar(WideString(fw))
You also report a separate problem that arises in the super object code. Specifically this line of code:
h := h*129 + ord(k[i]) + $9e370001;
raises an overflow error.
That happens because your project has the overflow checking option enabled (good practice to do so), but the super object code has been written under the assumption that the option is disabled. This is really a flaw in the super object code. You can solve it by disabling overflow checking in the super object code by adding {$OVERFLOWCHECKS OFF}
. Ideally this would be disabled very locally for just the code that intentionally overflows. However, unless you fully understand the code it may just be easier to stuff {$OVERFLOWCHECKS OFF}
at the top of the unit and move on.
Now, I'm looking at the very latest super object code and right at the top of the unit is {$OVERFLOWCHECKS OFF}
. So I wonder if you are perhaps using an out of date version of the code. Pull the latest version from the repo.