Hello! I can not understand how to work with encodings, or rather how I should be with them.
More ... There are 2 programs: 1 console application, the second simple program. I create a file with the program, encrypt the text and write it to a file. Through the console, I open this file, decipher the text and display it on the screen.
The problem is that this text is displayed in a different encoding. Using the "decoder" , I got the result I needed. It turns out that the text in the CP866 encoding is output to the console from the file, when the file itself, from where the text was taken, is in UTF-8 (without BOM) encoding.
I tried various options for changing the encoding. From a simple UTF8ToConsole (after the last release, Cyrillic is not displayed in the console when using this function, I personally changed the unit encoding just to CP866, otherwise I can’t display Russian characters to the console) to several functions that change the CP866 encoding → CP1251 → UTF -8, and so on. Whatever I do, nothing comes out. How can this be fixed?
PS I tried to change the encoding of the text when writing to the file. In my opinion, there is no need to dig, because text is encrypted before recording.
UPD1
readln(p); assignfile(f,p); reset(f); while not EOF(f) do begin Readln(f,s); writeln(AES.DecryptString(s)); writeln(s); end;
After all the attempts I decided to leave it as it is now. Encoding unit CP866.