# More precise error message for unencodable \`\\u\` escapes · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/0cef727e59d7b0c34756c09f64cbfe4490dcc3e7)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 0cef727e59d7b0c34756c09f64cbfe4490dcc3e7

Requested commit: 0cef727e59d7b0c34756c09f64cbfe4490dcc3e7

Commit: 0cef727e59d7b0c34756c09f64cbfe4490dcc3e7

Tree: 4cecb36f3903d8c97a9205dd33e7374cdc9b192f

Author: Ryan Liptak

Committer: Andrew Kelley

## Message

```
More precise error message for unencodable `\u` escapes

The surrogate code points U+D800 to U+DFFF are valid code points but are not Unicode scalar values. This commit makes the error message more accurately reflect what is actually allowed in `\u` escape sequences.

From https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf:

> D71 High-surrogate code point: A Unicode code point in the range U+D800 to U+DBFF.
> D73 Low-surrogate code point: A Unicode code point in the range U+DC00 to U+DFFF.
>
> 3.9 Unicode Encoding Forms
> D76 Unicode scalar value: Any Unicode code point except high-surrogate and low-surrogate code points.

Related: #20270

```

## Parents

- [44f4abf3805eb457525a474f243b71373b5c3824](https://git.cafe/gitcafe/zig/commit/44f4abf3805eb457525a474f243b71373b5c3824?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/0cef727e59d7b0c34756c09f64cbfe4490dcc3e7?format=markdown)
