Use replacement in transcoding instead of raising encoding errors