◐ Shell
clean mode source ↗

Message 369813 - Python tracker

In fact that python one-liner works with just about everything else that you can throw at it, just not something that "looks like utf-8 but isn't".

And of course adding LC_CTYPE=ascii or something like that fixes it, as you'd expect. Then the "surrogateescape" works fine, since mbstowcs() won't try to decode it as utf-8.