Can you run & provide output offollowing sql queries from pgAdmin4?
SHOW SERVER_ENCODING;
SHOW CLIENT_ENCODING;
And what is the encoding set for your current database connection on which you are trying to run query (Right click on your database, click on Properties > Definition Tab > Check Encoding, Collation & Character type) ?