---
title: "SW31008: Invalid UTF-8 offset"
description: "A requested byte offset is outside the source or inside a multibyte character."
image: "https://stillwind.dev/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://stillwind.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# SW31008: Invalid UTF-8 offset

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.

Source: https://stillwind.dev/docs/errors/SW31008/index.mdx
