Variable-width encoding