Force encoding on code snippet

Prevents issues as discussed with @noahd1 and @brynary