View Issue Details

IDProjectCategoryView StatusLast Update
0036570PatchesIDEpublic2020-01-14 14:02
ReporterMarco van de VoortAssigned ToOndrej Pokorny 
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
PlatformOSwindows OS Version1903 and higher
Product VersionProduct Build 
Target VersionFixed in Version 
Summary0036570: [patch] Windows EXEs be utf8 on startup.
DescriptionSince Windows 10 1903, Windows 10 has an option to manifest utf8 startup encoding. This patch adds support for this.

In theory in time this should also allow utf8 to pass to 1-byte encodings, but that is something for when win8 and older win10s are eol.

I looked at Lazarus manifest support, and it was easy to add. Only I couldn't seem to move the new checkbox, so both checkboxes (large filename and utf8default) are on top of each other. Also the room is a bit limited, and I didn't know if I can just enlarge the box.


The functionality is tested though (see steps to reproduce)
Steps To Reproducenew ->simple program,

program utf8wintest;

{$R *.res}

begin
   writeln('hello world: ',DefaultSystemCodePage);
end.

Compile runs, returns

hello world:1252

Now enable manifest utf8default option, result will be

hello world:65001
Additional InformationThis is my first GUI patch, so please thoroughly check the frame.
TagsNo tags attached.
Fixed in Revision62548
LazTarget-
WidgetsetWin32/Win64
Attached Files
  • utf8manifest.patch (16,434 bytes)
    Index: ide/frames/project_application_options.lfm
    ===================================================================
    --- ide/frames/project_application_options.lfm	(revision 62514)
    +++ ide/frames/project_application_options.lfm	(working copy)
    @@ -10,7 +10,7 @@
       DesignTop = 182
       object AppSettingsGroupBox: TGroupBox
         Left = 0
    -    Height = 490
    +    Height = 518
         Top = 0
         Width = 487
         Align = alTop
    @@ -17,7 +17,7 @@
         Anchors = []
         AutoSize = True
         Caption = 'AppSettingsGroupBox'
    -    ClientHeight = 472
    +    ClientHeight = 498
         ClientWidth = 483
         TabOrder = 0
         object TitleLabel: TLabel
    @@ -24,9 +24,9 @@
           AnchorSideTop.Control = TitleEdit
           AnchorSideTop.Side = asrCenter
           Left = 6
    -      Height = 13
    +      Height = 15
           Top = 10
    -      Width = 45
    +      Width = 50
           BorderSpacing.Left = 6
           Caption = 'TitleLabel'
           ParentColor = False
    @@ -35,9 +35,9 @@
           AnchorSideLeft.Control = TitleLabel
           AnchorSideTop.Control = IconPanel
           Left = 6
    -      Height = 13
    -      Top = 33
    -      Width = 46
    +      Height = 15
    +      Top = 35
    +      Width = 51
           Caption = 'IconLabel'
           ParentColor = False
         end
    @@ -47,9 +47,9 @@
           AnchorSideTop.Side = asrBottom
           AnchorSideRight.Control = IconTrack
           Left = 240
    -      Height = 13
    -      Top = 151
    -      Width = 72
    +      Height = 15
    +      Top = 161
    +      Width = 78
           BorderSpacing.Top = 8
           Caption = 'IconTrackLabel'
           ParentColor = False
    @@ -57,7 +57,7 @@
         object TitleEdit: TEdit
           AnchorSideRight.Side = asrBottom
           Left = 106
    -      Height = 21
    +      Height = 23
           Top = 6
           Width = 371
           Align = alTop
    @@ -71,9 +71,9 @@
           AnchorSideTop.Control = DarwinDividerBevel
           AnchorSideTop.Side = asrBottom
           Left = 6
    -      Height = 17
    -      Top = 420
    -      Width = 134
    +      Height = 19
    +      Top = 442
    +      Width = 151
           BorderSpacing.Top = 3
           Caption = 'UseAppBundleCheckBox'
           TabOrder = 12
    @@ -83,9 +83,9 @@
           AnchorSideTop.Control = WindowsDividerBevel
           AnchorSideTop.Side = asrBottom
           Left = 6
    -      Height = 17
    -      Top = 248
    -      Width = 136
    +      Height = 19
    +      Top = 254
    +      Width = 152
           BorderSpacing.Top = 3
           Caption = 'UseXPManifestCheckBox'
           OnChange = UseXPManifestCheckBoxChange
    @@ -97,7 +97,7 @@
           AnchorSideTop.Side = asrBottom
           Left = 106
           Height = 128
    -      Top = 33
    +      Top = 35
           Width = 128
           BorderSpacing.Left = 106
           BorderSpacing.Top = 6
    @@ -126,7 +126,7 @@
           AnchorSideRight.Side = asrBottom
           Left = 106
           Height = 46
    -      Top = 163
    +      Top = 165
           Width = 128
           Max = 0
           OnChange = IconTrackChange
    @@ -141,9 +141,9 @@
           AnchorSideTop.Control = ExecutionLevelComboBox
           AnchorSideTop.Side = asrBottom
           Left = 27
    -      Height = 17
    -      Top = 316
    -      Width = 109
    +      Height = 19
    +      Top = 328
    +      Width = 120
           BorderSpacing.Top = 3
           Caption = 'UIAccessCheckBox'
           TabOrder = 8
    @@ -154,13 +154,13 @@
           AnchorSideTop.Side = asrBottom
           AnchorSideRight.Control = DpiAwareComboBox
           AnchorSideRight.Side = asrBottom
    -      Left = 154
    -      Height = 21
    -      Top = 292
    -      Width = 323
    +      Left = 164
    +      Height = 23
    +      Top = 302
    +      Width = 313
           Anchors = [akTop, akLeft, akRight]
           BorderSpacing.Top = 3
    -      ItemHeight = 13
    +      ItemHeight = 15
           Style = csDropDownList
           TabOrder = 7
         end
    @@ -169,9 +169,9 @@
           AnchorSideTop.Control = ExecutionLevelComboBox
           AnchorSideTop.Side = asrCenter
           Left = 27
    -      Height = 13
    -      Top = 296
    -      Width = 97
    +      Height = 15
    +      Top = 306
    +      Width = 107
           Caption = 'ExecutionLevelLabel'
           ParentColor = False
         end
    @@ -180,8 +180,8 @@
           AnchorSideTop.Side = asrBottom
           AnchorSideRight.Side = asrBottom
           Left = 3
    -      Height = 13
    -      Top = 232
    +      Height = 15
    +      Top = 236
           Width = 477
           Caption = 'For Windows'
           Anchors = [akTop, akLeft, akRight]
    @@ -196,9 +196,9 @@
           AnchorSideTop.Control = UseAppBundleCheckBox
           AnchorSideTop.Side = asrBottom
           Left = 27
    -      Height = 23
    -      Top = 443
    -      Width = 142
    +      Height = 25
    +      Top = 467
    +      Width = 155
           AutoSize = True
           BorderSpacing.Left = 21
           BorderSpacing.Top = 6
    @@ -212,9 +212,9 @@
           AnchorSideTop.Control = DpiAwareComboBox
           AnchorSideTop.Side = asrCenter
           Left = 27
    -      Height = 13
    -      Top = 272
    -      Width = 71
    +      Height = 15
    +      Top = 280
    +      Width = 79
           BorderSpacing.Left = 21
           BorderSpacing.Top = 3
           Caption = 'DpiAwareLabel'
    @@ -227,14 +227,14 @@
           AnchorSideTop.Side = asrBottom
           AnchorSideRight.Control = TitleEdit
           AnchorSideRight.Side = asrBottom
    -      Left = 154
    -      Height = 21
    -      Top = 268
    -      Width = 323
    +      Left = 164
    +      Height = 23
    +      Top = 276
    +      Width = 313
           Anchors = [akTop, akLeft, akRight]
           BorderSpacing.Left = 30
           BorderSpacing.Top = 3
    -      ItemHeight = 13
    +      ItemHeight = 15
           Style = csDropDownList
           TabOrder = 6
         end
    @@ -243,9 +243,9 @@
           AnchorSideTop.Control = IconTrack
           AnchorSideTop.Side = asrBottom
           Left = 6
    -      Height = 17
    -      Top = 209
    -      Width = 133
    +      Height = 19
    +      Top = 211
    +      Width = 150
           Caption = 'UseLCLScalingCheckBox'
           TabOrder = 4
         end
    @@ -254,8 +254,8 @@
           AnchorSideTop.Side = asrBottom
           AnchorSideRight.Side = asrBottom
           Left = 3
    -      Height = 13
    -      Top = 404
    +      Height = 15
    +      Top = 424
           Width = 474
           Caption = 'For macOS (Darwin)'
           Anchors = [akTop, akLeft, akRight]
    @@ -270,9 +270,9 @@
           AnchorSideTop.Control = NameEdit
           AnchorSideTop.Side = asrCenter
           Left = 27
    -      Height = 13
    -      Top = 357
    -      Width = 52
    +      Height = 15
    +      Top = 373
    +      Width = 60
           Caption = 'NameLabel'
           ParentColor = False
         end
    @@ -281,9 +281,9 @@
           AnchorSideTop.Control = DescriptionEdit
           AnchorSideTop.Side = asrCenter
           Left = 27
    -      Height = 13
    -      Top = 381
    -      Width = 78
    +      Height = 15
    +      Top = 399
    +      Width = 88
           Caption = 'DescriptionLabel'
           ParentColor = False
         end
    @@ -293,10 +293,10 @@
           AnchorSideTop.Side = asrBottom
           AnchorSideRight.Control = DpiAwareComboBox
           AnchorSideRight.Side = asrBottom
    -      Left = 154
    -      Height = 21
    -      Top = 353
    -      Width = 323
    +      Left = 164
    +      Height = 23
    +      Top = 369
    +      Width = 313
           Anchors = [akTop, akLeft, akRight]
           BorderSpacing.Top = 3
           TabOrder = 10
    @@ -308,10 +308,10 @@
           AnchorSideTop.Side = asrBottom
           AnchorSideRight.Control = DpiAwareComboBox
           AnchorSideRight.Side = asrBottom
    -      Left = 154
    -      Height = 21
    -      Top = 377
    -      Width = 323
    +      Left = 164
    +      Height = 23
    +      Top = 395
    +      Width = 313
           Anchors = [akTop, akLeft, akRight]
           BorderSpacing.Top = 3
           TabOrder = 11
    @@ -322,9 +322,9 @@
           AnchorSideTop.Control = UIAccessCheckBox
           AnchorSideTop.Side = asrBottom
           Left = 27
    -      Height = 17
    -      Top = 333
    -      Width = 110
    +      Height = 19
    +      Top = 347
    +      Width = 124
           Caption = 'LongPathCheckBox'
           TabOrder = 9
         end
    @@ -333,9 +333,9 @@
           AnchorSideLeft.Side = asrBottom
           AnchorSideTop.Control = IconPanel
           Left = 240
    -      Height = 110
    -      Top = 33
    -      Width = 114
    +      Height = 118
    +      Top = 35
    +      Width = 123
           AutoSize = True
           BorderSpacing.Left = 6
           BevelOuter = bvNone
    @@ -342,14 +342,14 @@
           ChildSizing.VerticalSpacing = 6
           ChildSizing.Layout = cclLeftToRightThenTopToBottom
           ChildSizing.ControlsPerLine = 1
    -      ClientHeight = 110
    -      ClientWidth = 114
    +      ClientHeight = 118
    +      ClientWidth = 123
           TabOrder = 3
           object LoadIconButton: TBitBtn
             Left = 0
    -        Height = 23
    +        Height = 25
             Top = 0
    -        Width = 114
    +        Width = 123
             AutoSize = True
             Caption = 'LoadIconButton'
             OnClick = LoadIconButtonClick
    @@ -357,9 +357,9 @@
           end
           object DefaultIconButton: TBitBtn
             Left = 0
    -        Height = 23
    -        Top = 29
    -        Width = 114
    +        Height = 25
    +        Top = 31
    +        Width = 123
             AutoSize = True
             Caption = 'DefaultIconButton'
             OnClick = DefaultIconButtonClick
    @@ -367,9 +367,9 @@
           end
           object SaveIconButton: TBitBtn
             Left = 0
    -        Height = 23
    -        Top = 58
    -        Width = 114
    +        Height = 25
    +        Top = 62
    +        Width = 123
             AutoSize = True
             Caption = 'SaveIconButton'
             OnClick = SaveIconButtonClick
    @@ -377,9 +377,9 @@
           end
           object ClearIconButton: TBitBtn
             Left = 0
    -        Height = 23
    -        Top = 87
    -        Width = 114
    +        Height = 25
    +        Top = 93
    +        Width = 123
             AutoSize = True
             Caption = 'ClearIconButton'
             OnClick = ClearIconButtonClick
    @@ -386,13 +386,24 @@
             TabOrder = 3
           end
         end
    +    object UTF8DefaultCheckBox: TCheckBox
    +      AnchorSideLeft.Control = UIAccessCheckBox
    +      AnchorSideTop.Control = UIAccessCheckBox
    +      AnchorSideTop.Side = asrBottom
    +      Left = 27
    +      Height = 19
    +      Top = 347
    +      Width = 137
    +      Caption = 'UTF8DefaultCheckBox'
    +      TabOrder = 14
    +    end
       end
       object OpenPictureDialog1: TOpenPictureDialog
    -    left = 385
    -    top = 190
    +    Left = 385
    +    Top = 190
       end
       object SavePictureDialog1: TSavePictureDialog
    -    left = 385
    -    top = 249
    +    Left = 385
    +    Top = 249
       end
     end
    Index: ide/frames/project_application_options.pas
    ===================================================================
    --- ide/frames/project_application_options.pas	(revision 62514)
    +++ ide/frames/project_application_options.pas	(working copy)
    @@ -28,6 +28,7 @@
         DefaultIconButton: TBitBtn;
         LongPathCheckBox: TCheckBox;
         DarwinDividerBevel: TDividerBevel;
    +    UTF8DefaultCheckBox: TCheckBox;
         NameEdit: TEdit;
         DescriptionEdit: TEdit;
         NameLabel: TLabel;
    @@ -198,6 +199,7 @@
       ExecutionLevelComboBox.Enabled := aEnable;
       UIAccessCheckBox.Enabled := aEnable;
       LongPathCheckBox.Enabled := aEnable;
    +  UTF8DefaultCheckBox.Enabled := aEnable;
       NameEdit.Enabled := aEnable;
       DescriptionEdit.Enabled := aEnable;
     end;
    @@ -267,6 +269,7 @@
         DpiAwareComboBox.Items.Add(DpiLevelNames[DpiLevel] + ' (' + ManifestDpiAwareValues[DpiLevel] + ')');
       UIAccessCheckBox.Caption := dlgPOUIAccess;
       LongPathCheckBox.Caption := dlgPOLongPathAware;
    +  LongPathCheckBox.Caption := dlgPOUTF8Default;
       NameLabel.Caption := lisName;
       DescriptionLabel.Caption := lisCodeHelpDescrTag;
     
    @@ -312,6 +315,7 @@
           ExecutionLevelComboBox.ItemIndex := Ord(ExecutionLevel);
           UIAccessCheckBox.Checked := UIAccess;
           LongPathCheckBox.Checked := LongPathAware;
    +      UTF8DefaultCheckBox.Checked := UTF8Default;
           NameEdit.Text := TextName;
           DescriptionEdit.Text := TextDesc;
         end;
    @@ -352,6 +356,7 @@
           ExecutionLevel := TXPManifestExecutionLevel(ExecutionLevelComboBox.ItemIndex);
           UIAccess := UIAccessCheckBox.Checked;
           LongPathAware := LongPathCheckBox.Checked;
    +      UTF8Default   := UTF8DefaultCheckBox.Checked;
           TextName := NameEdit.Text;
           TextDesc := DescriptionEdit.Text;
         end;
    Index: ide/lazarusidestrconsts.pas
    ===================================================================
    --- ide/lazarusidestrconsts.pas	(revision 62514)
    +++ ide/lazarusidestrconsts.pas	(working copy)
    @@ -2715,6 +2715,7 @@
       dlgPODpiAwarenessOldOnNewPerMonitorV2 = 'Vista-8: on, 8.1/10+: per monitor/V2';
       dlgPOUIAccess = 'UI Access (uiAccess)';
       dlgPOLongPathAware = 'Long path awareness';
    +  dlgPOUTF8Default  = 'Codepage UTF8 Default (Windows 10 1903+)';
       dlgPOAsInvoker = 'as invoker (asInvoker)';
       dlgPOHighestAvailable = 'highest available (highestAvailable)';
       dlgPORequireAdministrator = 'require administrator (requireAdministrator)';
    Index: ide/w32manifest.pas
    ===================================================================
    --- ide/w32manifest.pas	(revision 62514)
    +++ ide/w32manifest.pas	(working copy)
    @@ -69,6 +69,7 @@
         FUIAccess: Boolean;
         FUseManifest: boolean;
         FLongPathAware: Boolean;
    +    FUTF8Default  : Boolean;
         FTextName: string;
         FTextDesc: string;
         procedure SetDpiAware(AValue: TXPManifestDpiAware);
    @@ -76,6 +77,7 @@
         procedure SetUIAccess(AValue: Boolean);
         procedure SetUseManifest(const AValue: boolean);
         procedure SetLongPathAware(AValue: Boolean);
    +    procedure SetUtf8Default(AValue: Boolean);
         procedure SetTextName(const AValue: string);
         procedure SetTextDesc(const AValue: string);
       public
    @@ -89,6 +91,7 @@
         property ExecutionLevel: TXPManifestExecutionLevel read FExecutionLevel write SetExecutionLevel;
         property UIAccess: Boolean read FUIAccess write SetUIAccess;
         property LongPathAware: Boolean read FLongPathAware write SetLongPathAware;
    +    property UTF8Default : Boolean read FUTF8Default write SetUtf8Default;
         property TextName: string read FTextName write SetTextName;
         property TextDesc: string read FTextDesc write SetTextDesc;
       end;
    @@ -116,6 +119,12 @@
         '<dpiAwareness>PerMonitorV2, PerMonitor</dpiAwareness>'
       );
     
    +  ManifestActiveCodepageUtf8 : array [boolean] of string = (
    +      '',
    +      '<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>'
    +  );
    +
    +
     implementation
     
     const
    @@ -157,6 +166,7 @@
         '  <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">'#$D#$A+
         '   %s'#$D#$A+
         '   <longPathAware>%s</longPathAware>'#$D#$A+
    +    '   %s'#$D#$A+
         '  </asmv3:windowsSettings>'#$D#$A+
         ' </asmv3:application>'#$D#$A+
         '</assembly>';
    @@ -189,6 +199,13 @@
       Modified := True;
     end;
     
    +procedure TProjectXPManifest.SetUtf8Default(AValue: Boolean);
    +begin
    +  if FUTF8Default = AValue then exit;
    +  FUTF8Default:= AValue;
    +  Modified := True;
    +end;
    +
     procedure TProjectXPManifest.SetDpiAware(AValue: TXPManifestDpiAware);
     begin
       if FDpiAware = AValue then Exit;
    @@ -233,6 +250,7 @@
       ExecutionLevel := xmelAsInvoker;
       UIAccess := False;
       LongPathAware := False;
    +  UTF8Default := False;
       TextName := DefaultXPManifestTextName;
       TextDesc := DefaultXPManifestTextDesc;
     end;
    @@ -259,7 +277,8 @@
           BoolToStr(UIAccess, 'true', 'false'),
           ManifestDpiAwareValues[DpiAware],
           ManifestDpiAwarenessValues[DpiAware],
    -      BoolToStr(LongPathAware, 'true', 'false')
    +      BoolToStr(LongPathAware, 'true', 'false'),
    +      ManifestActiveCodepageUtf8[FUTF8Default]
           ]);
         Res.RawData.Write(ManifestFileData[1], Length(ManifestFileData));
         AResources.AddSystemResource(Res);
    @@ -274,6 +293,7 @@
       TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/ExecutionLevel/Value', ExecutionLevelToStr[ExecutionLevel], ExecutionLevelToStr[xmelAsInvoker]);
       TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/UIAccess/Value', UIAccess, False);
       TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/LongPathAware/Value', LongPathAware, False);
    +  TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/UTF8Default/Value', UTF8Default, False);
       TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/TextName/Value', TextName, DefaultXPManifestTextName);
       TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/TextDesc/Value', TextDesc, DefaultXPManifestTextDesc);
     end;
    @@ -303,6 +323,7 @@
     
       UIAccess := Cfg.GetValue(Path+'General/XPManifest/UIAccess/Value', False);
       LongPathAware := Cfg.GetValue(Path+'General/XPManifest/LongPathAware/Value', False);
    +  UTF8Default := Cfg.GetValue(Path+'General/XPManifest/UTF8Default/Value', False);
       TextName := Cfg.GetValue(Path+'General/XPManifest/TextName/Value', TextName);
       TextDesc := Cfg.GetValue(Path+'General/XPManifest/TextDesc/Value', TextDesc);
     end;
    
    utf8manifest.patch (16,434 bytes)

Activities

Marco van de Voort

2020-01-14 12:19

manager  

utf8manifest.patch (16,434 bytes)
Index: ide/frames/project_application_options.lfm
===================================================================
--- ide/frames/project_application_options.lfm	(revision 62514)
+++ ide/frames/project_application_options.lfm	(working copy)
@@ -10,7 +10,7 @@
   DesignTop = 182
   object AppSettingsGroupBox: TGroupBox
     Left = 0
-    Height = 490
+    Height = 518
     Top = 0
     Width = 487
     Align = alTop
@@ -17,7 +17,7 @@
     Anchors = []
     AutoSize = True
     Caption = 'AppSettingsGroupBox'
-    ClientHeight = 472
+    ClientHeight = 498
     ClientWidth = 483
     TabOrder = 0
     object TitleLabel: TLabel
@@ -24,9 +24,9 @@
       AnchorSideTop.Control = TitleEdit
       AnchorSideTop.Side = asrCenter
       Left = 6
-      Height = 13
+      Height = 15
       Top = 10
-      Width = 45
+      Width = 50
       BorderSpacing.Left = 6
       Caption = 'TitleLabel'
       ParentColor = False
@@ -35,9 +35,9 @@
       AnchorSideLeft.Control = TitleLabel
       AnchorSideTop.Control = IconPanel
       Left = 6
-      Height = 13
-      Top = 33
-      Width = 46
+      Height = 15
+      Top = 35
+      Width = 51
       Caption = 'IconLabel'
       ParentColor = False
     end
@@ -47,9 +47,9 @@
       AnchorSideTop.Side = asrBottom
       AnchorSideRight.Control = IconTrack
       Left = 240
-      Height = 13
-      Top = 151
-      Width = 72
+      Height = 15
+      Top = 161
+      Width = 78
       BorderSpacing.Top = 8
       Caption = 'IconTrackLabel'
       ParentColor = False
@@ -57,7 +57,7 @@
     object TitleEdit: TEdit
       AnchorSideRight.Side = asrBottom
       Left = 106
-      Height = 21
+      Height = 23
       Top = 6
       Width = 371
       Align = alTop
@@ -71,9 +71,9 @@
       AnchorSideTop.Control = DarwinDividerBevel
       AnchorSideTop.Side = asrBottom
       Left = 6
-      Height = 17
-      Top = 420
-      Width = 134
+      Height = 19
+      Top = 442
+      Width = 151
       BorderSpacing.Top = 3
       Caption = 'UseAppBundleCheckBox'
       TabOrder = 12
@@ -83,9 +83,9 @@
       AnchorSideTop.Control = WindowsDividerBevel
       AnchorSideTop.Side = asrBottom
       Left = 6
-      Height = 17
-      Top = 248
-      Width = 136
+      Height = 19
+      Top = 254
+      Width = 152
       BorderSpacing.Top = 3
       Caption = 'UseXPManifestCheckBox'
       OnChange = UseXPManifestCheckBoxChange
@@ -97,7 +97,7 @@
       AnchorSideTop.Side = asrBottom
       Left = 106
       Height = 128
-      Top = 33
+      Top = 35
       Width = 128
       BorderSpacing.Left = 106
       BorderSpacing.Top = 6
@@ -126,7 +126,7 @@
       AnchorSideRight.Side = asrBottom
       Left = 106
       Height = 46
-      Top = 163
+      Top = 165
       Width = 128
       Max = 0
       OnChange = IconTrackChange
@@ -141,9 +141,9 @@
       AnchorSideTop.Control = ExecutionLevelComboBox
       AnchorSideTop.Side = asrBottom
       Left = 27
-      Height = 17
-      Top = 316
-      Width = 109
+      Height = 19
+      Top = 328
+      Width = 120
       BorderSpacing.Top = 3
       Caption = 'UIAccessCheckBox'
       TabOrder = 8
@@ -154,13 +154,13 @@
       AnchorSideTop.Side = asrBottom
       AnchorSideRight.Control = DpiAwareComboBox
       AnchorSideRight.Side = asrBottom
-      Left = 154
-      Height = 21
-      Top = 292
-      Width = 323
+      Left = 164
+      Height = 23
+      Top = 302
+      Width = 313
       Anchors = [akTop, akLeft, akRight]
       BorderSpacing.Top = 3
-      ItemHeight = 13
+      ItemHeight = 15
       Style = csDropDownList
       TabOrder = 7
     end
@@ -169,9 +169,9 @@
       AnchorSideTop.Control = ExecutionLevelComboBox
       AnchorSideTop.Side = asrCenter
       Left = 27
-      Height = 13
-      Top = 296
-      Width = 97
+      Height = 15
+      Top = 306
+      Width = 107
       Caption = 'ExecutionLevelLabel'
       ParentColor = False
     end
@@ -180,8 +180,8 @@
       AnchorSideTop.Side = asrBottom
       AnchorSideRight.Side = asrBottom
       Left = 3
-      Height = 13
-      Top = 232
+      Height = 15
+      Top = 236
       Width = 477
       Caption = 'For Windows'
       Anchors = [akTop, akLeft, akRight]
@@ -196,9 +196,9 @@
       AnchorSideTop.Control = UseAppBundleCheckBox
       AnchorSideTop.Side = asrBottom
       Left = 27
-      Height = 23
-      Top = 443
-      Width = 142
+      Height = 25
+      Top = 467
+      Width = 155
       AutoSize = True
       BorderSpacing.Left = 21
       BorderSpacing.Top = 6
@@ -212,9 +212,9 @@
       AnchorSideTop.Control = DpiAwareComboBox
       AnchorSideTop.Side = asrCenter
       Left = 27
-      Height = 13
-      Top = 272
-      Width = 71
+      Height = 15
+      Top = 280
+      Width = 79
       BorderSpacing.Left = 21
       BorderSpacing.Top = 3
       Caption = 'DpiAwareLabel'
@@ -227,14 +227,14 @@
       AnchorSideTop.Side = asrBottom
       AnchorSideRight.Control = TitleEdit
       AnchorSideRight.Side = asrBottom
-      Left = 154
-      Height = 21
-      Top = 268
-      Width = 323
+      Left = 164
+      Height = 23
+      Top = 276
+      Width = 313
       Anchors = [akTop, akLeft, akRight]
       BorderSpacing.Left = 30
       BorderSpacing.Top = 3
-      ItemHeight = 13
+      ItemHeight = 15
       Style = csDropDownList
       TabOrder = 6
     end
@@ -243,9 +243,9 @@
       AnchorSideTop.Control = IconTrack
       AnchorSideTop.Side = asrBottom
       Left = 6
-      Height = 17
-      Top = 209
-      Width = 133
+      Height = 19
+      Top = 211
+      Width = 150
       Caption = 'UseLCLScalingCheckBox'
       TabOrder = 4
     end
@@ -254,8 +254,8 @@
       AnchorSideTop.Side = asrBottom
       AnchorSideRight.Side = asrBottom
       Left = 3
-      Height = 13
-      Top = 404
+      Height = 15
+      Top = 424
       Width = 474
       Caption = 'For macOS (Darwin)'
       Anchors = [akTop, akLeft, akRight]
@@ -270,9 +270,9 @@
       AnchorSideTop.Control = NameEdit
       AnchorSideTop.Side = asrCenter
       Left = 27
-      Height = 13
-      Top = 357
-      Width = 52
+      Height = 15
+      Top = 373
+      Width = 60
       Caption = 'NameLabel'
       ParentColor = False
     end
@@ -281,9 +281,9 @@
       AnchorSideTop.Control = DescriptionEdit
       AnchorSideTop.Side = asrCenter
       Left = 27
-      Height = 13
-      Top = 381
-      Width = 78
+      Height = 15
+      Top = 399
+      Width = 88
       Caption = 'DescriptionLabel'
       ParentColor = False
     end
@@ -293,10 +293,10 @@
       AnchorSideTop.Side = asrBottom
       AnchorSideRight.Control = DpiAwareComboBox
       AnchorSideRight.Side = asrBottom
-      Left = 154
-      Height = 21
-      Top = 353
-      Width = 323
+      Left = 164
+      Height = 23
+      Top = 369
+      Width = 313
       Anchors = [akTop, akLeft, akRight]
       BorderSpacing.Top = 3
       TabOrder = 10
@@ -308,10 +308,10 @@
       AnchorSideTop.Side = asrBottom
       AnchorSideRight.Control = DpiAwareComboBox
       AnchorSideRight.Side = asrBottom
-      Left = 154
-      Height = 21
-      Top = 377
-      Width = 323
+      Left = 164
+      Height = 23
+      Top = 395
+      Width = 313
       Anchors = [akTop, akLeft, akRight]
       BorderSpacing.Top = 3
       TabOrder = 11
@@ -322,9 +322,9 @@
       AnchorSideTop.Control = UIAccessCheckBox
       AnchorSideTop.Side = asrBottom
       Left = 27
-      Height = 17
-      Top = 333
-      Width = 110
+      Height = 19
+      Top = 347
+      Width = 124
       Caption = 'LongPathCheckBox'
       TabOrder = 9
     end
@@ -333,9 +333,9 @@
       AnchorSideLeft.Side = asrBottom
       AnchorSideTop.Control = IconPanel
       Left = 240
-      Height = 110
-      Top = 33
-      Width = 114
+      Height = 118
+      Top = 35
+      Width = 123
       AutoSize = True
       BorderSpacing.Left = 6
       BevelOuter = bvNone
@@ -342,14 +342,14 @@
       ChildSizing.VerticalSpacing = 6
       ChildSizing.Layout = cclLeftToRightThenTopToBottom
       ChildSizing.ControlsPerLine = 1
-      ClientHeight = 110
-      ClientWidth = 114
+      ClientHeight = 118
+      ClientWidth = 123
       TabOrder = 3
       object LoadIconButton: TBitBtn
         Left = 0
-        Height = 23
+        Height = 25
         Top = 0
-        Width = 114
+        Width = 123
         AutoSize = True
         Caption = 'LoadIconButton'
         OnClick = LoadIconButtonClick
@@ -357,9 +357,9 @@
       end
       object DefaultIconButton: TBitBtn
         Left = 0
-        Height = 23
-        Top = 29
-        Width = 114
+        Height = 25
+        Top = 31
+        Width = 123
         AutoSize = True
         Caption = 'DefaultIconButton'
         OnClick = DefaultIconButtonClick
@@ -367,9 +367,9 @@
       end
       object SaveIconButton: TBitBtn
         Left = 0
-        Height = 23
-        Top = 58
-        Width = 114
+        Height = 25
+        Top = 62
+        Width = 123
         AutoSize = True
         Caption = 'SaveIconButton'
         OnClick = SaveIconButtonClick
@@ -377,9 +377,9 @@
       end
       object ClearIconButton: TBitBtn
         Left = 0
-        Height = 23
-        Top = 87
-        Width = 114
+        Height = 25
+        Top = 93
+        Width = 123
         AutoSize = True
         Caption = 'ClearIconButton'
         OnClick = ClearIconButtonClick
@@ -386,13 +386,24 @@
         TabOrder = 3
       end
     end
+    object UTF8DefaultCheckBox: TCheckBox
+      AnchorSideLeft.Control = UIAccessCheckBox
+      AnchorSideTop.Control = UIAccessCheckBox
+      AnchorSideTop.Side = asrBottom
+      Left = 27
+      Height = 19
+      Top = 347
+      Width = 137
+      Caption = 'UTF8DefaultCheckBox'
+      TabOrder = 14
+    end
   end
   object OpenPictureDialog1: TOpenPictureDialog
-    left = 385
-    top = 190
+    Left = 385
+    Top = 190
   end
   object SavePictureDialog1: TSavePictureDialog
-    left = 385
-    top = 249
+    Left = 385
+    Top = 249
   end
 end
Index: ide/frames/project_application_options.pas
===================================================================
--- ide/frames/project_application_options.pas	(revision 62514)
+++ ide/frames/project_application_options.pas	(working copy)
@@ -28,6 +28,7 @@
     DefaultIconButton: TBitBtn;
     LongPathCheckBox: TCheckBox;
     DarwinDividerBevel: TDividerBevel;
+    UTF8DefaultCheckBox: TCheckBox;
     NameEdit: TEdit;
     DescriptionEdit: TEdit;
     NameLabel: TLabel;
@@ -198,6 +199,7 @@
   ExecutionLevelComboBox.Enabled := aEnable;
   UIAccessCheckBox.Enabled := aEnable;
   LongPathCheckBox.Enabled := aEnable;
+  UTF8DefaultCheckBox.Enabled := aEnable;
   NameEdit.Enabled := aEnable;
   DescriptionEdit.Enabled := aEnable;
 end;
@@ -267,6 +269,7 @@
     DpiAwareComboBox.Items.Add(DpiLevelNames[DpiLevel] + ' (' + ManifestDpiAwareValues[DpiLevel] + ')');
   UIAccessCheckBox.Caption := dlgPOUIAccess;
   LongPathCheckBox.Caption := dlgPOLongPathAware;
+  LongPathCheckBox.Caption := dlgPOUTF8Default;
   NameLabel.Caption := lisName;
   DescriptionLabel.Caption := lisCodeHelpDescrTag;
 
@@ -312,6 +315,7 @@
       ExecutionLevelComboBox.ItemIndex := Ord(ExecutionLevel);
       UIAccessCheckBox.Checked := UIAccess;
       LongPathCheckBox.Checked := LongPathAware;
+      UTF8DefaultCheckBox.Checked := UTF8Default;
       NameEdit.Text := TextName;
       DescriptionEdit.Text := TextDesc;
     end;
@@ -352,6 +356,7 @@
       ExecutionLevel := TXPManifestExecutionLevel(ExecutionLevelComboBox.ItemIndex);
       UIAccess := UIAccessCheckBox.Checked;
       LongPathAware := LongPathCheckBox.Checked;
+      UTF8Default   := UTF8DefaultCheckBox.Checked;
       TextName := NameEdit.Text;
       TextDesc := DescriptionEdit.Text;
     end;
Index: ide/lazarusidestrconsts.pas
===================================================================
--- ide/lazarusidestrconsts.pas	(revision 62514)
+++ ide/lazarusidestrconsts.pas	(working copy)
@@ -2715,6 +2715,7 @@
   dlgPODpiAwarenessOldOnNewPerMonitorV2 = 'Vista-8: on, 8.1/10+: per monitor/V2';
   dlgPOUIAccess = 'UI Access (uiAccess)';
   dlgPOLongPathAware = 'Long path awareness';
+  dlgPOUTF8Default  = 'Codepage UTF8 Default (Windows 10 1903+)';
   dlgPOAsInvoker = 'as invoker (asInvoker)';
   dlgPOHighestAvailable = 'highest available (highestAvailable)';
   dlgPORequireAdministrator = 'require administrator (requireAdministrator)';
Index: ide/w32manifest.pas
===================================================================
--- ide/w32manifest.pas	(revision 62514)
+++ ide/w32manifest.pas	(working copy)
@@ -69,6 +69,7 @@
     FUIAccess: Boolean;
     FUseManifest: boolean;
     FLongPathAware: Boolean;
+    FUTF8Default  : Boolean;
     FTextName: string;
     FTextDesc: string;
     procedure SetDpiAware(AValue: TXPManifestDpiAware);
@@ -76,6 +77,7 @@
     procedure SetUIAccess(AValue: Boolean);
     procedure SetUseManifest(const AValue: boolean);
     procedure SetLongPathAware(AValue: Boolean);
+    procedure SetUtf8Default(AValue: Boolean);
     procedure SetTextName(const AValue: string);
     procedure SetTextDesc(const AValue: string);
   public
@@ -89,6 +91,7 @@
     property ExecutionLevel: TXPManifestExecutionLevel read FExecutionLevel write SetExecutionLevel;
     property UIAccess: Boolean read FUIAccess write SetUIAccess;
     property LongPathAware: Boolean read FLongPathAware write SetLongPathAware;
+    property UTF8Default : Boolean read FUTF8Default write SetUtf8Default;
     property TextName: string read FTextName write SetTextName;
     property TextDesc: string read FTextDesc write SetTextDesc;
   end;
@@ -116,6 +119,12 @@
     '<dpiAwareness>PerMonitorV2, PerMonitor</dpiAwareness>'
   );
 
+  ManifestActiveCodepageUtf8 : array [boolean] of string = (
+      '',
+      '<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>'
+  );
+
+
 implementation
 
 const
@@ -157,6 +166,7 @@
     '  <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">'#$D#$A+
     '   %s'#$D#$A+
     '   <longPathAware>%s</longPathAware>'#$D#$A+
+    '   %s'#$D#$A+
     '  </asmv3:windowsSettings>'#$D#$A+
     ' </asmv3:application>'#$D#$A+
     '</assembly>';
@@ -189,6 +199,13 @@
   Modified := True;
 end;
 
+procedure TProjectXPManifest.SetUtf8Default(AValue: Boolean);
+begin
+  if FUTF8Default = AValue then exit;
+  FUTF8Default:= AValue;
+  Modified := True;
+end;
+
 procedure TProjectXPManifest.SetDpiAware(AValue: TXPManifestDpiAware);
 begin
   if FDpiAware = AValue then Exit;
@@ -233,6 +250,7 @@
   ExecutionLevel := xmelAsInvoker;
   UIAccess := False;
   LongPathAware := False;
+  UTF8Default := False;
   TextName := DefaultXPManifestTextName;
   TextDesc := DefaultXPManifestTextDesc;
 end;
@@ -259,7 +277,8 @@
       BoolToStr(UIAccess, 'true', 'false'),
       ManifestDpiAwareValues[DpiAware],
       ManifestDpiAwarenessValues[DpiAware],
-      BoolToStr(LongPathAware, 'true', 'false')
+      BoolToStr(LongPathAware, 'true', 'false'),
+      ManifestActiveCodepageUtf8[FUTF8Default]
       ]);
     Res.RawData.Write(ManifestFileData[1], Length(ManifestFileData));
     AResources.AddSystemResource(Res);
@@ -274,6 +293,7 @@
   TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/ExecutionLevel/Value', ExecutionLevelToStr[ExecutionLevel], ExecutionLevelToStr[xmelAsInvoker]);
   TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/UIAccess/Value', UIAccess, False);
   TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/LongPathAware/Value', LongPathAware, False);
+  TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/UTF8Default/Value', UTF8Default, False);
   TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/TextName/Value', TextName, DefaultXPManifestTextName);
   TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/TextDesc/Value', TextDesc, DefaultXPManifestTextDesc);
 end;
@@ -303,6 +323,7 @@
 
   UIAccess := Cfg.GetValue(Path+'General/XPManifest/UIAccess/Value', False);
   LongPathAware := Cfg.GetValue(Path+'General/XPManifest/LongPathAware/Value', False);
+  UTF8Default := Cfg.GetValue(Path+'General/XPManifest/UTF8Default/Value', False);
   TextName := Cfg.GetValue(Path+'General/XPManifest/TextName/Value', TextName);
   TextDesc := Cfg.GetValue(Path+'General/XPManifest/TextDesc/Value', TextDesc);
 end;
utf8manifest.patch (16,434 bytes)

CudaText man

2020-01-14 13:41

reporter   ~0120427

Last edited: 2020-01-14 13:42

View 2 revisions

One checkbox is on top of other? then right-click both checkboxes, and call Anchor Editor dialog, and set anchors of controls (also all controls below the checkbox, which now must anchor to NEW checkbox).

Ondrej Pokorny

2020-01-14 13:59

developer   ~0120429

I fixed the anchors problem and allowed myself to rename the variable and the checkbox to be more self-explanatory. Thank you!

Marco van de Voort

2020-01-14 14:02

manager   ~0120431

Link for the functionality is https://docs.microsoft.com/en-us/windows/uwp/design/globalizing/use-utf8-code-page btw

Issue History

Date Modified Username Field Change
2020-01-14 12:19 Marco van de Voort New Issue
2020-01-14 12:19 Marco van de Voort File Added: utf8manifest.patch
2020-01-14 12:21 Marco van de Voort Severity minor => feature
2020-01-14 12:21 Marco van de Voort LazTarget => -
2020-01-14 12:21 Marco van de Voort Widgetset Win32/Win64 => Win32/Win64
2020-01-14 12:30 Marco van de Voort Project Lazarus => Patches
2020-01-14 12:30 Marco van de Voort Steps to Reproduce Updated View Revisions
2020-01-14 12:30 Marco van de Voort Widgetset Win32/Win64 => Win32/Win64
2020-01-14 12:45 Ondrej Pokorny Assigned To => Ondrej Pokorny
2020-01-14 12:45 Ondrej Pokorny Status new => assigned
2020-01-14 13:41 CudaText man Note Added: 0120427
2020-01-14 13:42 CudaText man Note Edited: 0120427 View Revisions
2020-01-14 13:59 Ondrej Pokorny Status assigned => resolved
2020-01-14 13:59 Ondrej Pokorny Resolution open => fixed
2020-01-14 13:59 Ondrej Pokorny Fixed in Revision => 62548
2020-01-14 13:59 Ondrej Pokorny Widgetset Win32/Win64 => Win32/Win64
2020-01-14 13:59 Ondrej Pokorny Note Added: 0120429
2020-01-14 14:02 Marco van de Voort Note Added: 0120431