Updated to work with arbitrary byte escape sequences.