# utf8_fromwc

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/utf8.c#L608
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-utf8_fromwc/

```c
enum utf8_state utf8_fromwc(wchar_t wc, struct utf8_data *ud)
```

## Parameters

- `wc` (`wchar_t`)
- `ud` (`struct utf8_data *`)

## Called by

- [`tty_keys_extended_key`](/en/tmux/latest/reference/c-function-tty-keys-c-tty_keys_extended_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty-keys.c#L1127)

## Calls

- [`log_debug`](/en/tmux/latest/reference/c-function-log_debug/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/utf8.c#L618)
- [`utf8_width`](/en/tmux/latest/reference/c-function-utf8-c-utf8_width/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/utf8.c#L625)

## Referenced declarations

- [`utf8_data.data`](/en/tmux/latest/reference/c-struct-utf8_data-data/) (attribute)
- [`utf8_data.have`](/en/tmux/latest/reference/c-struct-utf8_data-have/) (attribute)
- [`utf8_data.size`](/en/tmux/latest/reference/c-struct-utf8_data-size/) (attribute)
- [`utf8_data`](/en/tmux/latest/reference/c-struct-utf8_data/) (struct)
- [`UTF8_DONE`](/en/tmux/latest/reference/c-enum-utf8_state-utf8_done/) (constant)
- [`UTF8_ERROR`](/en/tmux/latest/reference/c-enum-utf8_state-utf8_error/) (constant)
- [`utf8_state`](/en/tmux/latest/reference/c-enum-utf8_state/) (enum)
- [`utf8_width_item.wc`](/en/tmux/latest/reference/c-struct-utf8_width_item-wc/) (attribute)
- [`utf8_data.width`](/en/tmux/latest/reference/c-struct-utf8_data-width/) (attribute)
- [`utf8_width_item.width`](/en/tmux/latest/reference/c-struct-utf8_width_item-width/) (attribute)
