code_to_utf8
size_t wchr_len = code_to_utf8(wchr, (uint32_t)val);
narrow_len += code_to_utf8(pos, outbuf[i]);