<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/166598>166598</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [libc] Support `%lc` in printf
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          michaelrj-google
      </td>
    </tr>
</table>

<pre>
    Currently our printf implementation just ignores the length modifier for char. We should use the internal `wcrtomb` to first convert the wchar to utf-8 then write it to the output.

Standard: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf#page=343
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxUkcGOpCwUhZ8GN6QMXsSqWrio_-_4Ar2YNcJVqSAYuLTpt5_gdDKZlcn14-TkfDpntwbEkan_mPpodKEtpnF3ZtPo0_u2xrh6bOZov8f_S0oYyH_zWBI_kgu0cLcfHncMpMnFwN8lE3driAkzpw25x7DSxvdo3eIw8SUmbjadWv4Led5i8ZaXjBfrAmEK2nM2iNMkivvMBsEp8sWlTNzE8IWJLvasIfVXoeX2qKfAz-QIuaN6rkwsdBRqmXgx8fokHaxOlskX34iOzOSLwcRgOs-zjQeGWybbxrQymN5kOgZTNgAVWLv-D8dgstFkBlOQAKI97MJAHnpFJj9kLxs7SvuUT93g2N0HkEN_l9Bs42IGFNDDw6LoZqUAl8XqAWa5KNMJ27gRBKiuE6q790qKdr4_zV3i8_FUshvMg_UCd-186_3XXms2LueCYzcM6vlovJ7R58sjgHezYQDVaBorf5vLmlkvvMuU_yaQI3-5vx6oD_5ZjiMmqgIYKG_q_C78uG5K8uO_062OtjK3Ju4Mphr787kdKb7REIPpalkX-yn6NcLvAAAA___Vx80U">