#musl on freenode pointed out that http://git.musl-libc.org/cgit/musl/tree/src/locale/wcsxfrm.c has a better fix for this already (this patch returns the wrong number), so we should probably merge that instead.