Skip to content

Commit 597da7d

Browse files
committed
fix: explicitly set client encoding on PG connection
Refs #2465
1 parent 9fc551d commit 597da7d

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
@@ -2935,6 +2935,7 @@ procedure TPgConnection.SetActive(Value: Boolean);
29352935
raise EDbError.Create(Error, LastErrorCode, ErrorHint);
29362936
end;
29372937
FActive := True;
2938+
CharacterSet := 'UTF8';
29382939
FServerDateTimeOnStartup := GetVar('SELECT ' + FSqlProvider.GetSql(qFuncNow));
29392940
FServerVersionUntouched := GetVar('SELECT VERSION()');
29402941
FConnectionStarted := GetTickCount div 1000;
@@ -4610,7 +4611,7 @@ procedure TMySQLConnection.SetCharacterSet(CharsetName: String);
46104611
procedure TPGConnection.SetCharacterSet(CharsetName: String);
46114612
begin
46124613
// See issue #22
4613-
Query('SET CLIENT_ENCODING TO ' + EscapeString('UTF8'));
4614+
Query('SET CLIENT_ENCODING TO ' + EscapeString(CharsetName));
46144615
end;
46154616

46164617

0 commit comments

Comments
 (0)