Change setFromEscapedString to take the string plus begin and end offsets.