The mb
/wc
functions convert between the wchar_t encoding, which is platform-specific, and the multibyte encoding, which is platform and locale-specific.
On Linux on x86, wc
is likely to be UTF-32LE and mb
is most likely, but far from guaranteed, to be UTF-8. On Windows, wc
is UTF-16LE; mb
is likely to be the machine's default locale (ANSI) code page and vanishingly unlikely to be UTF-8.
So if you want to convert to or from known, specific encodings, you have to use iconv()
.