How would you design an 8-bit encoding of a set of 256 characters from western languages (say, with the same characters as ISO 8859-1) if it had not to be backward-compatible with ASCII?
I'm thinking to rules of thumb like these: if ABC...XYZabc...xyz0123...89
were, in this order, the first characters of the set (codes from 0 to 61), then isalpha(c)
would just need the comparison c < 52
, isalnum(c)
would be c < 62
, and so on.
If, otherwise, 0123...89
were the first characters, maybe atoi()
and the like would be easier to implement.
Another idea: if the letters were sorted like AaBbCcDdEeFf...
or aàáâãbcdeèéêëfgh...
, I think that dictionary-like sorting of strings would be more efficient.
Finally: is there a rationale behind 0
being the terminator of C strings instead of, say, 255
?