keys in struct encoding should be sorted as raw strings, not alphanumerics