1. A method of encoding successive user data words into respective code words, the method comprising: (a) mapping each data word into data segments that are constrained to a first number of bit patterns, which is less than a second number of bit patterns that satisfy a first constraint; (b) encoding the data segments into intermediate code word segments selected from a first set of the bit patterns that satisfy the first constraint, wherein at least some of the bit patterns in the first set violate a second constraint; and (c) encoding the intermediate code word segments into respective code word segments by encoding the intermediate code word segments that violate the second constraint with code word segments selected from a second, different set of the bit patterns that satisfy the first constraint and the second constraint.