Skip to content

Commit 79c5e4c

Browse files
committed
fix: explicitly set client encoding on PG connection
Refs #2465
1 parent 305534d commit 79c5e4c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

source/dbconnection.pas

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2807,6 +2807,7 @@ procedure TPgConnection.SetActive(Value: Boolean);
28072807
raise EDbError.Create(Error, LastErrorCode, ErrorHint);
28082808
end;
28092809
FActive := True;
2810+
CharacterSet := 'UTF8';
28102811
FServerDateTimeOnStartup := GetVar('SELECT ' + FSqlProvider.GetSql(qFuncNow));
28112812
FServerVersionUntouched := GetVar('SELECT VERSION()');
28122813
FConnectionStarted := GetTickCount64 div 1000;
@@ -4463,7 +4464,7 @@ procedure TMySQLConnection.SetCharacterSet(CharsetName: String);
44634464
procedure TPGConnection.SetCharacterSet(CharsetName: String);
44644465
begin
44654466
// See issue #22
4466-
Query('SET CLIENT_ENCODING TO ' + EscapeString('UTF8'));
4467+
Query('SET CLIENT_ENCODING TO ' + EscapeString(CharsetName));
44674468
end;
44684469

44694470

0 commit comments

Comments
 (0)