I am reading text containing emojis from a Postgres 13 database. Turns out that my Python/psycopg query does not decode/return the text as I would expect.
Via Postgres psql
client
Within
postgres:13
containerselect description from profile WHERE id = 123
Result is as expected!
️ and ⚕️
Via Python 3.9 with psycopg3 adapter
- Within a
python:3.9
container - same query as above
The result is not correctly retuned - fails to combine
>>> cur = conn.cursor()
>>> profiles = cur.fetchone()
>>> profiles[0]
️\u200d and \u200d\u200d⚕️
Connection object says it is using utf-8
>>> conn.info.encoding
'utf-8'
What am I missing here?
Any idea what I should be looking for?
Many thanks for your thoughts in advance, much appreciated! Eu