More encoding shenanigans. Thanks asparagui