Closed delphidabbler closed 2 years ago
Main database file reader needs to be revised to use ANSI code page 1252 instead of Default encoding in TMainDBFileReader.GetFileEncoding
.
Encodings are disposed of safely, so no worries about a memory leek using a non built in TEncoding.
For user database code that needs changing to use ANSI code page 1252 is in GetSourceCodePropertyText
of local function of TXMLDataReader.GetSnippetProps
.
In this case encoding we need will have to be safely freed.
Code importing is XML based and it seems it can be trusted.
Old text backup file format use Default encoding. In this case that that is the best we can do, since files are created on user's own computer and hopefully decoded on same computer.
Actually, this issue is wrong in its premise. User databases were created on their computers using their default ANSI code page, so the Default encoding is fine.
However there is a problem with old copies of the main database.
Therefore this issue is being closed and a new one relating to main database is to be opened.
CodeSnip's code that reads legacy user database files (v4 and earlier) treats source code data file as being encoded in the system's default ANSI code page.
This is fine in the UK, but may cause problems in other countries. Therefore the code needs to be changed to use ANSI code page 1252, which is the default code page in the UK.
Need to check other formats (e.g. the export file format) to see if they needs altering similarly.