mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 20:00:16 +08:00
TRegistry cannot handle widestrings. Fix restoring last used database name if that contains international characters.
This commit is contained in:
@ -779,7 +779,7 @@ begin
|
|||||||
if MainForm.GetRegValue( REGNAME_RESTORELASTUSEDDB, DEFAULT_RESTORELASTUSEDDB ) and ( lastUsedDB <> '' ) then
|
if MainForm.GetRegValue( REGNAME_RESTORELASTUSEDDB, DEFAULT_RESTORELASTUSEDDB ) and ( lastUsedDB <> '' ) then
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
ActiveDatabase := lastUsedDB;
|
ActiveDatabase := Utf8Decode(lastUsedDB);
|
||||||
except
|
except
|
||||||
// Suppress exception message when db was dropped externally or
|
// Suppress exception message when db was dropped externally or
|
||||||
// the session was just opened with "OnlyDBs" in place and the
|
// the session was just opened with "OnlyDBs" in place and the
|
||||||
@ -972,7 +972,7 @@ begin
|
|||||||
// Open server-specific registry-folder.
|
// Open server-specific registry-folder.
|
||||||
// relative from already opened folder!
|
// relative from already opened folder!
|
||||||
reg.OpenKey( REGKEY_SESSIONS + FConn.Description, true );
|
reg.OpenKey( REGKEY_SESSIONS + FConn.Description, true );
|
||||||
reg.WriteString( REGNAME_LASTUSEDDB, ActiveDatabase );
|
reg.WriteString( REGNAME_LASTUSEDDB, Utf8Encode(ActiveDatabase) );
|
||||||
end;
|
end;
|
||||||
FreeAndNil(reg);
|
FreeAndNil(reg);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user