I am using this Delphi-Unit. I am forced to use this old Delphi implementation, so don't ask about that: https://github.com/foxitsoftware/DelphiZXingQRCode
The QRcodes it produces are decoded by any decoders just fine, as long as I keep the error correction level at "Low". If I increase the error correction level, the generated codes can not be decoded by any decoder I tried so far. But I am forced (by a standard) to use an error correction level of Medium, no more no less.
However it is not clear how to increase the error correction level (ecl from now on). I assume it to be hardcoded in the file DelphiZXingQRCode on line 3491: Level.FBits := 1. I found some information on hexnumbers representing ecls, but I can't find it now. But I tried those hexnumbers as bits and the ecl-bits on the QRcode changed accordingly. So I assumed the hexnumbers to be correct (1=Low, 0=Medium, 2=High, 3=Quartile).
Here is an example of a QRcode with Level.FBits := 2, meaning I wanted the ecl to be "High". The content ist "Hello world". The cross image in the middle is part of a standard [sic] I have to implement, so don't ask about that.
Has anyone any idea how to fix this? I tried...well...I tried to understand the code but it's too much. I just can't fix it. If I can't get it fixed by someone else, I will have to...find another solution. Which will be a problem.
Solved. See code below. Method GenerateQRCode() now requires a parameter for the ErrorCorrectionLevel: Integers 0-3. Seems to work. I had to remove some unchanged lines, because the file is too large for StackOverflow. Merge yourself.