ASCII values problem between D3 and D7

From: John Anderson (john_at_fish_head_gear.co.uk)
Date: 10/30/03


Date: Thu, 30 Oct 2003 21:36:11 -0000

Hi,

I've got some passwords which were encrypted in Clipper 5 by adding a
certain amount to the ASCII value of each character. In Delphi 3, I can turn
these back into meaningful strings by subtracting the same values. In
Delphi 7, tho, the same encrypted characters are showing as higher ASCII
value, so when I subtract a value they come back as a different character.
For example, the character for Chr(146) in D3 is the character for Chr(198)
in D7. Unfortunately, the displacement isn't consistent, for example
encrypted numbers come back OK.

I tried putting the encrypt/decipher routines in a D3 DLL and calling that
from D7, but something's getting lost in the translation - valid PChar and
integer values passed into the DLL are appearing within it as garbage. (Is
this a Delphi version incompatibility? I've always had problems calling
DLL's not created with the same version of Delphi.) Then I tried creating a
D3 COM object to do the translation. This works, but behaves the same way as
Delphi 7. I've also tried using OemToChar (or whatever it's called) - this
gave different results but still wrong.

Can anyone either tell me what I'm missing or suggest a solution?

TIA

John



Relevant Pages

  • Re: ASCII values problem between D3 and D7
    ... >these back into meaningful strings by subtracting the same values. ... >Delphi 7, tho, the same encrypted characters are showing as higher ASCII ... so when I subtract a value they come back as a different character. ...
    (borland.public.delphi.language.objectpascal)
  • Re: ASCII values problem between D3 and D7
    ... I don't have Delphi 7 in front of me, but remember that Delphi 7 has moved ... Be careful however on where Delphi 7 strings come from and look up ... so when I subtract a value they come back as a different character. ... > I tried putting the encrypt/decipher routines in a D3 DLL and calling that ...
    (borland.public.delphi.language.objectpascal)
  • Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
    ... We have cannot go to 2 bytes per character since it will double our memory consumption. ... Will it cost extra money, ... I think there are a lot of big Win32 Delphi products that won't be able to make the switch to the new compiler due to the amount of work and the risk. ... So if most "old" system developers can't make the jump to Delphi 2008 it might be another nail on Delphi's coffin. ...
    (borland.public.delphi.non-technical)
  • Re: To-do list facility
    ... > character 35 is called a "pound sign", ... > ASCII International Variant, ... > which bears no resemblance whatsoever to a pound sign. ... Keypad tapped numbers 035 in Delphi Editor and then also in Windows ...
    (comp.lang.pascal.delphi.misc)
  • Re: Question: how to read any one character from keyboard
    ... Doesn't anyone use Delphi anymore? ... The Read procedure is used to read one character from the keyboard. ... The help says that if you use Read with a Char var, ... You can create a console window with in a GUI app at the ...
    (alt.comp.lang.borland-delphi)