Skip to content

Commit 75a0f7f

Browse files
committed
feat: create checkbox in advanced session setting for new ForceUnicode setting
https://www.heidisql.com/forum.php?t=45113
1 parent ed9a94f commit 75a0f7f

3 files changed

Lines changed: 44 additions & 20 deletions

File tree

extra/locale/heidisql.po

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: HeidiSQL\n"
99
"POT-Creation-Date: 2012-11-05 21:40\n"
10-
"PO-Revision-Date: 2026-05-24 13:19+0200\n"
10+
"PO-Revision-Date: 2026-06-03 17:02+0200\n"
1111
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
1212
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n"
1313
"Language: en\n"
@@ -352,6 +352,9 @@ msgstr "Use Windows authentication"
352352
msgid "Enable cleartext authentication"
353353
msgstr "Enable cleartext authentication"
354354

355+
msgid "Force Unicode (disable on old servers only)"
356+
msgstr "Force Unicode (disable on old servers only)"
357+
355358
#. connform..PageControlDetails..tabSettings..chkLocalTimeZone....Hint
356359
#: connections.dfm:406
357360
msgid "Use your client time zone in date/time SQL functions, e.g. NOW(), for MySQL 4.1.3+"

source/connections.lfm

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ object connform: Tconnform
3333
Height = 455
3434
Top = 10
3535
Width = 521
36-
ActivePage = tabSettings
36+
ActivePage = tabStart
3737
Align = alClient
3838
Images = MainForm.ImageListMain
39-
TabIndex = 1
39+
TabIndex = 0
4040
TabOrder = 1
4141
OnChange = PageControlDetailsChange
4242
object tabStart: TTabSheet
@@ -626,11 +626,11 @@ object connform: Tconnform
626626
Caption = 'Ping every X seconds:'
627627
end
628628
object lblBackgroundColor: TLabel
629-
AnchorSideTop.Control = chkCleartextPluginEnabled
629+
AnchorSideTop.Control = chkForceUnicode
630630
AnchorSideTop.Side = asrBottom
631631
Left = 3
632632
Height = 15
633-
Top = 161
633+
Top = 185
634634
Width = 97
635635
BorderSpacing.Around = 5
636636
Caption = 'Background color:'
@@ -640,7 +640,7 @@ object connform: Tconnform
640640
AnchorSideTop.Side = asrBottom
641641
Left = 3
642642
Height = 15
643-
Top = 188
643+
Top = 212
644644
Width = 119
645645
BorderSpacing.Around = 5
646646
Caption = 'Hide database pattern:'
@@ -650,7 +650,7 @@ object connform: Tconnform
650650
AnchorSideTop.Side = asrBottom
651651
Left = 3
652652
Height = 15
653-
Top = 216
653+
Top = 240
654654
Width = 97
655655
BorderSpacing.Around = 5
656656
Caption = 'Log queries to file:'
@@ -748,11 +748,11 @@ object connform: Tconnform
748748
Value = 0
749749
end
750750
object ColorBoxBackgroundColor: TColorBox
751-
AnchorSideTop.Control = chkCleartextPluginEnabled
751+
AnchorSideTop.Control = chkForceUnicode
752752
AnchorSideTop.Side = asrBottom
753753
Left = 194
754754
Height = 22
755-
Top = 161
755+
Top = 185
756756
Width = 314
757757
NoneColorColor = clNone
758758
Selected = clNone
@@ -770,7 +770,7 @@ object connform: Tconnform
770770
AnchorSideTop.Side = asrBottom
771771
Left = 194
772772
Height = 23
773-
Top = 188
773+
Top = 212
774774
Width = 314
775775
Anchors = [akTop, akLeft, akRight]
776776
BorderSpacing.Around = 5
@@ -783,7 +783,7 @@ object connform: Tconnform
783783
AnchorSideTop.Side = asrBottom
784784
Left = 194
785785
Height = 19
786-
Top = 244
786+
Top = 268
787787
Width = 314
788788
Anchors = [akTop, akLeft, akRight]
789789
BorderSpacing.Around = 5
@@ -796,7 +796,7 @@ object connform: Tconnform
796796
AnchorSideTop.Side = asrBottom
797797
Left = 194
798798
Height = 23
799-
Top = 216
799+
Top = 240
800800
Width = 314
801801
Anchors = [akTop, akLeft, akRight]
802802
BorderSpacing.Around = 5
@@ -816,14 +816,27 @@ object connform: Tconnform
816816
AnchorSideTop.Side = asrBottom
817817
Left = 194
818818
Height = 19
819-
Top = 268
819+
Top = 292
820820
Width = 314
821821
Anchors = [akTop, akLeft, akRight]
822822
BorderSpacing.Around = 5
823823
Caption = 'DML queries (INSERT, UPDATE, ...)'
824824
TabOrder = 10
825825
OnClick = Modification
826826
end
827+
object chkForceUnicode: TCheckBox
828+
AnchorSideTop.Control = chkCleartextPluginEnabled
829+
AnchorSideTop.Side = asrBottom
830+
Left = 194
831+
Height = 19
832+
Top = 161
833+
Width = 314
834+
Anchors = [akTop, akLeft, akRight]
835+
BorderSpacing.Around = 5
836+
Caption = 'Force Unicode (disable on old servers only)'
837+
TabOrder = 11
838+
OnClick = Modification
839+
end
827840
end
828841
object tabSSL: TTabSheet
829842
Caption = 'SSL'

source/connections.pas

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Tconnform = class(TExtForm)
2626
btnSave: TBitBtn;
2727
btnNew: TBitBtn;
2828
btnDelete: TBitBtn;
29+
chkForceUnicode: TCheckBox;
2930
lblHelpPortable: TLabel;
3031
lblSshPassHint: TLabel;
3132
pnlBottom: TPanel;
@@ -495,6 +496,7 @@ procedure Tconnform.btnSaveClick(Sender: TObject);
495496
Sess.LoginPrompt := chkLoginPrompt.Checked;
496497
Sess.WindowsAuth := chkWindowsAuth.Checked;
497498
Sess.CleartextPluginEnabled := chkCleartextPluginEnabled.Checked;
499+
Sess.ForceUnicode := chkForceUnicode.Checked;
498500
Sess.Port := spinPort.Value;
499501
Sess.NetType := SelectedNetType;
500502
Sess.Compressed := chkCompressed.Checked;
@@ -724,6 +726,7 @@ function Tconnform.CurrentParams: TConnectionParameters;
724726
Result.LoginPrompt := chkLoginPrompt.Checked;
725727
Result.WindowsAuth := chkWindowsAuth.Checked;
726728
Result.CleartextPluginEnabled := chkCleartextPluginEnabled.Checked;
729+
Result.ForceUnicode := chkForceUnicode.Checked;
727730
if spinPort.Enabled then
728731
Result.Port := spinPort.Value
729732
else
@@ -1040,6 +1043,7 @@ procedure Tconnform.ListSessionsFocusChanged(Sender: TBaseVirtualTree;
10401043
chkLoginPrompt.Checked := Sess.LoginPrompt;
10411044
chkWindowsAuth.Checked := Sess.WindowsAuth;
10421045
chkCleartextPluginEnabled.Checked := Sess.CleartextPluginEnabled;
1046+
chkForceUnicode.Checked := Sess.ForceUnicode;
10431047
spinPort.Value := Sess.Port;
10441048
chkCompressed.Checked := Sess.Compressed;
10451049
spinQueryTimeout.Value := Sess.QueryTimeout;
@@ -1474,6 +1478,7 @@ procedure Tconnform.Modification(Sender: TObject);
14741478
or (Sess.LoginPrompt <> chkLoginPrompt.Checked)
14751479
or (Sess.WindowsAuth <> chkWindowsAuth.Checked)
14761480
or (Sess.CleartextPluginEnabled <> chkCleartextPluginEnabled.Checked)
1481+
or (Sess.ForceUnicode <> chkForceUnicode.Checked)
14771482
or (Sess.Port <> spinPort.Value)
14781483
or (Sess.Compressed <> chkCompressed.Checked)
14791484
or (Sess.QueryTimeout <> spinQueryTimeout.Value)
@@ -1511,7 +1516,8 @@ procedure Tconnform.Modification(Sender: TObject);
15111516
FSessionModified := FSessionModified or PasswordModified;
15121517
if (Sender=editHost) or (Sender=editUsername) or (Sender=editPassword) or
15131518
(Sender=comboNetType) or (Sender=chkWindowsAuth) or (Sender=spinPort) or
1514-
(Sender=chkCleartextPluginEnabled) then begin
1519+
(Sender=chkCleartextPluginEnabled) or (Sender=chkForceUnicode)
1520+
then begin
15151521
// Be sure to use the modified connection params next time the user clicks the "Databases" pulldown
15161522
FreeAndNil(FPopupDatabases);
15171523
end;
@@ -1629,6 +1635,14 @@ procedure Tconnform.ValidateControls;
16291635
lblSSHLocalPort.Enabled := Params.SSHActive;
16301636
spinSSHlocalport.Enabled := Params.SSHActive;
16311637
// Advanced tab:
1638+
lblQueryTimeout.Enabled := True;
1639+
spinQueryTimeout.Enabled := lblQueryTimeout.Enabled;
1640+
chkLocalTimeZone.Enabled := Params.NetTypeGroup = ngMySQL;
1641+
chkFullTableStatus.Enabled := (Params.NetTypeGroup in [ngMySQL, ngPgSQL, ngSQLite]) and (Params.NetType <> ntMySQL_ProxySQLAdmin);
1642+
chkCleartextPluginEnabled.Enabled := Params.NetTypeGroup = ngMySQL;
1643+
chkForceUnicode.Enabled := Params.NetTypeGroup = ngMySQL;
1644+
editLogFilePath.Enabled := Params.LogFileDdl or Params.LogFileDml;
1645+
// SSL tab:
16321646
chkWantSSL.Enabled := Params.NetType in [ntMySQL_TCPIP, ntMySQL_SSHtunnel, ntMySQL_ProxySQLAdmin, ntMySQL_RDS, ntPgSQL_TCPIP, ntPgSQL_SSHtunnel];
16331647
lblSSLPrivateKey.Enabled := Params.WantSSL;
16341648
editSSLPrivateKey.Enabled := Params.WantSSL;
@@ -1640,12 +1654,6 @@ procedure Tconnform.ValidateControls;
16401654
editSSLcipher.Enabled := Params.WantSSL;
16411655
lblSSLVerification.Enabled := Params.WantSSL;
16421656
comboSSLVerification.Enabled := Params.WantSSL;
1643-
lblQueryTimeout.Enabled := True;
1644-
spinQueryTimeout.Enabled := lblQueryTimeout.Enabled;
1645-
chkLocalTimeZone.Enabled := Params.NetTypeGroup = ngMySQL;
1646-
chkFullTableStatus.Enabled := (Params.NetTypeGroup in [ngMySQL, ngPgSQL, ngSQLite]) and (Params.NetType <> ntMySQL_ProxySQLAdmin);
1647-
chkCleartextPluginEnabled.Enabled := Params.NetTypeGroup = ngMySQL;
1648-
editLogFilePath.Enabled := Params.LogFileDdl or Params.LogFileDml;
16491657

16501658
Params.Free;
16511659
end;

0 commit comments

Comments
 (0)