In C (using gcc), is it possible to use a 4 char [a-z] "literal" ( e.g. "enus"/{'e','n','u','s'}/... ) as an uint16_t ?
I'd like to be able to use 4 char locale ( like 'en-us', but 'enus' is okay as well, as the '-' is superfluous afaik) as an unsigned 16 bit integer directly in my code without any runtime overhead.
E.g. 'en-us' could be mapped to (('e' - 96) << 12) | (('n' - 96) << 8) | (('u' - 96) << 4) | ('s' - 96). (This is only an example, I'm fine with any mapping/algorithm that at least leaves the value 0 untouched (for detecting "nothing set"))
Any solution would not need to be portable (WRT endianess etc), but should have no runtime overhead over actually using a uint16_t.
Thank you very much!
P.S.: Feel free to add more tags to the question, wasn't sure what to use other than "c". Thx.