Skip to content

SW31008: Invalid UTF-8 offset

A requested byte offset is outside the source or inside a multibyte character.

This error occurs when an integration or a tool asks for a UTF-8 byte offset that is outside the source, or that falls inside a character of several 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 byte offsets for byte-based APIs. Convert UTF-16 editor positions with the source service instead of counting characters.