str: stop encoding invalid out-of-range `char`