---
title: "U0005: Invalid escape sequence"
url: https://una-lang.org/en/docs/errors/U0005/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/crates/una-explain/explain/U0005.md
---

# U0005: Invalid escape sequence

U0005 reports a backslash in a text literal that does not start a valid escape sequence.

## Why Una rejects it

Inside a text literal, a backslash starts an escape sequence. The valid escapes are `\"`, `\\`, `\n`, `\t`, `\{`, `\}` and `\u{H}`, where `H` is one to six hexadecimal digits naming a Unicode scalar value (`spec/01 §6`).

U0005 reports:

- any other character after a backslash,
- a `\u` escape without braces or digits,
- a code point that is a surrogate or above `10FFFF`.

## How to fix it

Write a backslash itself as `\\`.

## The repair at a glance

```diff
  module demo

- pub folder() -> Text = "C:\data"
+ pub folder() -> Text = "C:\\data"
```

## Failing example

```una
module demo

pub folder() -> Text = "C:\data"
```

## Fixed example

```una
module demo

pub folder() -> Text = "C:\\data"
```
