---
title: "invalid-utf8"
description: "Detect invalid UTF-8 arguments to strings functions."
image: "https://strider.gempir.com/og.png"
---

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

# invalid-utf8

**Default severity:** `error`

Reports invalid constant cutsets and character lists passed to selected
`strings` functions.

## Bad

```go
strings.Trim(value, "\xff") // reported
```

## Good

```go
strings.Trim(value, "é")
```

Source: https://strider.gempir.com/analyzers/invalid-utf8/index.mdx
