# std::basic_ios<CharT,Traits>::widen

> C++ Atlas: `cppatlas.com/w/cpp/io/basic_ios/widen` | Source: https://en.cppreference.com/w/cpp/io/basic_ios/widen | Domain: Input/output

Converts a character c to its equivalent in the current locale. The result is converted from char to character type used within the stream if needed.

## Official Specification Summary (cppreference)

```cpp
char_type widen( char c ) const;
```

Converts a character `c` to its equivalent in the current locale. The result is converted from `char` to character type used within the stream if needed.

Effectively calls `std::use_facet< std::ctype<char_type> >(getloc()).widen(c)`.

### Parameters

- `c` - character to convert

### Return value

Character converted to `char_type`

### See also

- [`narrow`](https://en.cppreference.com/w/cpp/io/basic_ios/narrow): narrows characters (public member function)
- [`do_widen`](https://en.cppreference.com/w/cpp/locale/ctype/widen) [virtual]: converts a character or characters from `char` to `CharT` (virtual protected member function of `std::ctype<CharT>`)
- [`btowc`](https://en.cppreference.com/w/cpp/string/multibyte/btowc): widens a single-byte narrow character to wide character, if possible (function)

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