Issue with Ñ character in name (migrated data from MySQL to PostgreSQL) I'm currently running a test migration of data from MySQL to PostgreSQL. I'm using psycopg2 to perform the task. 

I was able to migrate the person's information but when I check the data for comparison, some lastnames with Ñ are showing as "?" in psql while some show as Ñ. I checked both server and client encoding in PostgreSQL and they are set to UTF8. 

Where should I start troubleshooting this? I'm new to this kind of task.
You can start troubleshooting this by looking at the bytes behind the characters, to check if there are invalid UTF-8 contents independently of the display layer.

An UTF-8 string can be converted into its series of bytes in SQL with

SELECT convert_to(value, 'UTF-8');


You may also split a suspicious string character by character to look at each codepoint individually, with the character, the Unicode codepoint, and the UTF-8 representation

SELECT c, to_hex(ascii(c)), convert_to(c, 'UTF-8') FROM
   regexp_split_to_table('El Niño', '') AS c;

 c | to_hex | convert_to 
---+--------+------------
 E | 45     | \x45
 l | 6c     | \x6c
   | 20     | \x20
 N | 4e     | \x4e
 i | 69     | \x69
 ñ | f1     | \xc3b1
 o | 6f     | \x6f


I would try this on the  fields where some characters display as ? and compare with the fields where the characters display correctly. The goal is to identify what's exactly behind the ?.