Encode spaces