Skip to content

SW31006: Invalid UTF-16 offset

A requested UTF-16 offset is outside the source or inside a character.

This error occurs when an integration or a tool asks for a UTF-16 offset that is not a valid position in the source, such as an offset past the end. UTF-16 offsets count code units, not bytes.

How to fix

  • With an official integration, report the error with the file and the action that caused it.
  • In your own integration, use offsets from the same revision of the source, and convert explicitly between byte offsets and UTF-16 offsets.