From Baidu Translator: Just look at the picture, the text will not be reviewed and there will be no indication of any issues.
The reason is that I recently wanted to use VC to encapsulate read and write ini files, so I referred to VCL's TIniFile. However, I found that its source code is not the best, and it is not even as cross platform as Lazarus.
Let's talk about it:
1. If it does not exceed the section content and does not exceed 16K, then it will be read directly without recalculation. If it exceeds 16k, complex calculations are used, the entire file is read in, and then recalculated, there is actually a problem here. Since we have already read the entire file, why do we need to recalculate it? This is not unnecessary, and it also consumes twice the memory space.
2. Delphi did not have the time to read ini on its own, but instead used the Windows API. There was a problem with the API. When the file was UTF-8, it read garbled code, and Delphi did not handle it. Moreover, the API itself does not support Chinese as section and key names. Of course, this is not a problem with Delphi, but with the Microsoft API.
3. Compared to Lazarus' implementation, it uses its own way of reading and writing, and achieves cross platform performance. Delphi can only be bound to the Windows platform using APIs, of course, ini itself is a thing of the past for the Windows platform.