# std::codecvt_base

> C++ Atlas: `cppatlas.com/w/cpp/locale/codecvt_base` | Source: https://en.cppreference.com/w/cpp/locale/codecvt_base | Domain: Localization

The class std::codecvt_base provides the conversion status constants which are inherited and used by the std::codecvt facets.

## Official Specification Summary (cppreference)

```cpp
// Defined in header <locale>
class codecvt_base;
```

The class `std::codecvt_base` provides the conversion status constants which are inherited and used by the `std::codecvt` facets.

### Member types

**Member type — Definition**

- `enum result { ok, partial, error, noconv };`: Unscoped enumeration type

**Value — Explanation**

- `ok`: conversion was completed with no error
- `partial`: not all source characters were converted
- `error`: encountered an invalid character
- `noconv`: no conversion required, input and output types are the same

### Notes

The value `std::codecvt_base::partial` is used to indicate that either the destination range is too short to receive the results of the conversion or the input is truncated in the middle of an otherwise valid multibyte character.

### See also

- [`codecvt`](https://en.cppreference.com/w/cpp/locale/codecvt): converts between character encodings, including UTF-8, UTF-16, UTF-32 (class template)

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