mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Fix unicode table names and comments in alter table dialog
This commit is contained in:
@ -73,7 +73,7 @@ type
|
||||
{$I const.inc}
|
||||
|
||||
function trimc(s: String; c: Char) : String;
|
||||
function implodestr(seperator: String; a: TWideStringList) :WideString;
|
||||
function implodestr(seperator: WideString; a: TWideStringList) :WideString;
|
||||
function explode(separator, a: WideString) :TWideStringList;
|
||||
procedure ensureValidIdentifier(name: String);
|
||||
function getEnumValues(str: WideString): WideString;
|
||||
@ -228,19 +228,17 @@ end;
|
||||
@param a TStringList Containing strings
|
||||
@return string
|
||||
}
|
||||
function implodestr(seperator: String; a: TWideStringList) :WideString;
|
||||
function implodestr(seperator: WideString; a: TWideStringList) :WideString;
|
||||
var
|
||||
i : Integer;
|
||||
text : String;
|
||||
begin
|
||||
result := '';
|
||||
Result := '';
|
||||
for i:=0 to a.Count-1 do
|
||||
begin
|
||||
text := text + a[i];
|
||||
Result := Result + a[i];
|
||||
if i < a.Count-1 then
|
||||
text := text + seperator;
|
||||
Result := Result + seperator;
|
||||
end;
|
||||
result := text;
|
||||
end;
|
||||
|
||||
|
||||
|
@ -111,7 +111,7 @@ object tbl_properties_form: Ttbl_properties_form
|
||||
ModalResult = 2
|
||||
TabOrder = 7
|
||||
end
|
||||
object editName: TEdit
|
||||
object editName: TTntEdit
|
||||
Left = 88
|
||||
Top = 17
|
||||
Width = 216
|
||||
@ -121,7 +121,7 @@ object tbl_properties_form: Ttbl_properties_form
|
||||
Text = 'editName'
|
||||
OnChange = editNameChange
|
||||
end
|
||||
object editComment: TEdit
|
||||
object editComment: TTntEdit
|
||||
Left = 88
|
||||
Top = 42
|
||||
Width = 216
|
||||
|
@ -10,14 +10,14 @@ interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Classes, Controls, Forms, Graphics,
|
||||
Dialogs, StdCtrls, Db, Menus, SynMemo, SynEdit, WideStrings;
|
||||
Dialogs, StdCtrls, Db, Menus, SynMemo, SynEdit, WideStrings, TntStdCtrls;
|
||||
|
||||
type
|
||||
Ttbl_properties_form = class(TForm)
|
||||
lblName: TLabel;
|
||||
editName: TEdit;
|
||||
editName: TTntEdit;
|
||||
lblComment: TLabel;
|
||||
editComment: TEdit;
|
||||
editComment: TTntEdit;
|
||||
lblEngine: TLabel;
|
||||
comboEngine: TComboBox;
|
||||
lblCharset: TLabel;
|
||||
@ -50,9 +50,9 @@ type
|
||||
currentEngine,
|
||||
currentCharset,
|
||||
currentCollation,
|
||||
currentAutoincrement : String;
|
||||
currentAutoincrement : WideString;
|
||||
public
|
||||
TableName : String;
|
||||
TableName : WideString;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -123,7 +123,7 @@ end;
|
||||
procedure Ttbl_properties_form.FormShow(Sender: TObject);
|
||||
var
|
||||
ds: TDataSet;
|
||||
sql : String;
|
||||
sql : WideString;
|
||||
begin
|
||||
// Fetch table properties
|
||||
sql := 'SHOW TABLE STATUS ';
|
||||
@ -131,11 +131,11 @@ begin
|
||||
ds := Mainform.Childwin.GetResults(sql);
|
||||
|
||||
// Table name
|
||||
currentName := ds.FieldByName('Name').AsString;
|
||||
currentName := ds.FieldByName('Name').AsWideString;
|
||||
editName.Text := currentName;
|
||||
|
||||
// Comment
|
||||
currentComment := ds.FieldByName('Comment').AsString;
|
||||
currentComment := ds.FieldByName('Comment').AsWideString;
|
||||
editComment.Text := currentComment;
|
||||
|
||||
// Engine
|
||||
@ -262,7 +262,7 @@ end;
|
||||
procedure Ttbl_properties_form.FormClose(Sender: TObject; var Action:
|
||||
TCloseAction);
|
||||
var
|
||||
sql, tmp : String;
|
||||
sql, tmp : WideString;
|
||||
AlterSpecs : TWideStringList;
|
||||
begin
|
||||
if ModalResult = mrOK then
|
||||
|
Reference in New Issue
Block a user