On 24/12/2013, Silvan Jegen <s.je...@gmail.com> wrote: > So I guess the question boils down to whether you would rather use > libutf or the standardized, POSIX-locale-dependent wchar.h functions for > the UTF-8 conversion. I see one advantage of the wchar.h functions: > If we use them we could avoid adding an external dependency to > sbase. The disadvantage is the fact that we would depend on the > whole posix-locale-thing which seems unnecessarily complicated in > places.
Use wchar.h functions and a sane libc, e.g. musl, which has a pure UTF-8 C locale, which ISO C explicitly allows [1]. The 8-bit clarity what POSIX wants [1] seems nonsense to me, as one can use byte functions for that, but I may be wrong. [1] http://wiki.musl-libc.org/wiki/Functional_differences_from_glibc