---
title: "SW31006: Invalid UTF-16 offset"
description: "A requested UTF-16 offset is outside the source or inside a 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.

# SW31006: Invalid UTF-16 offset

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.

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