Conversion for Delphi 2009 unicode issue -
I am converting a link from Delphi 7 to Delphi 2009. I found this error: E2010 Incompatible Type: 'Four' and 'Anscher' How can I fix this? I tried to declare the alphabet: Ansistring failed on [AlphabetLength].
const alphabet = 64; Alphabet: String [Alphabet Langghi] = 'ABCDEFGHHLMNOPQRTUVXbackDDFGILMNAPCrustWoxix 0123456789 +/'; Function TBase64.ValueToCharacter (value: byte; var character: char): boolean; Start the result: = true; If (value> alphabet lang -1) result: = false else // compilation error E2010 incompatible type: 'four' and 'AnsiChar' characters: = alphabet (value + 1); End; Function TBase64.CharacterToValue (character: char; var value: byte): boolean; Start the result: = true; Value: = status (character, alphabet); If value = 0 then results: = wrong other value: = value -1; End; Avoid using the excluded shortstring type in Unicode Delphi versions (2009 and later):
const alphabet = 64; Alphabet = 'ABCDFGHISHLMNOPQRTUVWXAzBackDFGILMNPCrustWoxix 0123456789 +/';
The above changes must be sufficient. You should also consider changing 2-byte characters from 1-Byte AnsiChars.
Edit (Jeroen Plumeir):
Here.
Comments
Post a Comment