If you really have up to 8 such `bits`, then you can binary encoding of the strings and use general constraints as follows:
define z0 as binary variable and z1 as integer variable and for each possible value of y1-y8, define wi as binary variable and vi the binary expansion, then
regular constraints:
c0: x1 + 2x2 + 4 x3 + 8 x4 + 16 x5 + 32 x6 + 64 x7 + 128 x8 + z1 = 1 + 8 + 64
c1: z1 <= 255 * (1-z0)
c2: z1 >= -255 * (1-z0)
c3: sum wi = 1
indicator constraints:
g1: z0 = 1 -> y1 + 2y2 + 4y3 + 8y4 + 16y5 + 32y6 +64y7 +128y8 = sum wi * vi
In theory you can always do that trick (i.e. is a correct reformulation)... but the numerics will start to suffer at some point (for sure for 32 bits, but probably much earlier)