Though formatting mangled the registry key to add, the article is interesting: since 2003 (C# Builder 1), you can force the IDE to always save files as UTF8 which should alleviate a lot of encoding problems.
It beats me why this isn’t the default setting, but below is an example .reg file for Delphi 8 which should be easily transformed to more recent Delphi versions:
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Software\Borland\BDS\2.0\Editor] | |
"DefaultFileFilter"="Borland.FileFilter.UTF8ToUTF8" |
So basically (if formatting is kept), you browse to this key (replace Borland with the company for your specific Delphi version, and replace 2.0 by your IDE version):
HKEY_CURRENT_USER\Software\Borland\BDS\16.0\Editor
Then you add a new string value named DefaultFileFilter
with value Borland.FileFilter.UTF8ToUTF8
More background [WayBack] The Oracle at Delphi: More IDE secrets – UTF8 and the Editor
The unmangled registry key (and more tips) was from [WayBack] BSC Polska: Hidden possibilities of Delphi 8.
Get the list of HKEY_CURRENT_USER
paths for your Delphi version at Update to List-Delphi-Installed-Packages.ps1 shows HKCU/HKLM keys and doesn’t truncated fields any more.
–jeroen
Via: [WayBack] Is there any way (IDE expert?) to automatic set encoding of each PAS file in UTF-8 instead of ANSI? – Jacek Laskowski – Google+