Sets the attributes to the elements of the given range.
with ErrInvalidArgument if fromIndex or toIndex splits a UTF-16 surrogate pair.