# C++ keyword: char8_t (since C++20)

> C++ Atlas: `cppatlas.com/w/cpp/keyword/char8_t` | Source: https://en.cppreference.com/w/cpp/keyword/char8_t | Domain: Keywords | Standards: C++11, C++20

char8_t type: as the declaration of the type

## Official Specification Summary (cppreference)

### Usage

`char8_t` type: as the declaration of the type

### Notes

| Feature-test macro | Value | Std | Feature |
| --- | --- | --- | --- |
| `__cpp_char8_t` | `201811L` | (C++20) | `char8_t` |
| `__cpp_char8_t` | `202207L` | (C++20) (DR) | `char8_t` compatibility and portability fix (allow initialization of (`unsigned`) `char` arrays from UTF-8 string literals) |

### See also

- [Fundamental types](https://en.cppreference.com/w/cpp/language/types): [`void`](https://en.cppreference.com/w/cpp/keyword/void), [`std::nullptr_t`](https://en.cppreference.com/w/cpp/types/nullptr_t) (since C++11).
  - [Integral types](https://en.cppreference.com/w/cpp/language/types#Integral_types): [`int`](https://en.cppreference.com/w/cpp/keyword/int). [Modifiers](https://en.cppreference.com/w/cpp/language/types#Modifiers): [`signed`](https://en.cppreference.com/w/cpp/keyword/signed), [`unsigned`](https://en.cppreference.com/w/cpp/keyword/unsigned), [`short`](https://en.cppreference.com/w/cpp/keyword/short), [`long`](https://en.cppreference.com/w/cpp/keyword/long).
    - [Boolean type](https://en.cppreference.com/w/cpp/language/types#Boolean_type): [`bool`](https://en.cppreference.com/w/cpp/keyword/bool). [Boolean literals](https://en.cppreference.com/w/cpp/language/bool_literal): [`false`](https://en.cppreference.com/w/cpp/keyword/false), [`true`](https://en.cppreference.com/w/cpp/keyword/true).
    - [Character types](https://en.cppreference.com/w/cpp/language/types#Character_types): [`char`](https://en.cppreference.com/w/cpp/keyword/char), `char8_t` (since C++20), [`char16_t`](https://en.cppreference.com/w/cpp/keyword/char16_t), [`char32_t`](https://en.cppreference.com/w/cpp/keyword/char32_t) (since C++11), [`wchar_t`](https://en.cppreference.com/w/cpp/keyword/wchar_t).
  - [Floating-point types](https://en.cppreference.com/w/cpp/language/types#Floating-point_types): [`float`](https://en.cppreference.com/w/cpp/keyword/float), [`double`](https://en.cppreference.com/w/cpp/keyword/double).

---
Attribution: content from https://en.cppreference.com/w/cpp/keyword/char8_t (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.