Text this: General encoding of canonical k-mers