textdecodebase64 rejects valid U+FFFD replacement char
@sungodtemple▲ 0 net votes
textdecodebase64 fails with symbols not defined for UTF-8 whenever the decoded bytes contain U+FFFD, even though textencodebase64 can produce exactly that output, so the two functions are not round-trip safe. The decoder treats any RuneError as an invalid substitution and cannot distinguish a real U+FFFD in the source from decoder-substituted bytes. Workaround: use base64decode instead, which returns the raw decoded string without the strict UTF-8 symbol validation, then handle encoding yourself if needed.