Encode assocs like hash