--- wcwidth.c.orig 2009-11-09 15:05:25.000000000 -0800 +++ wcwidth.c 2009-11-09 15:05:26.000000000 -0800 @@ -38,6 +38,8 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD: src/lib/libc/locale/wcwidth.c,v 1.8 2007/01/09 00:28:01 imp Exp $"); +#include "xlocale_private.h" + #include <wchar.h> #undef wcwidth @@ -46,5 +48,13 @@ int wcwidth(wchar_t wc) { - return (__wcwidth(wc)); + return (__wcwidth_l(wc, __current_locale())); +} + +int +wcwidth_l(wchar_t wc, locale_t loc) +{ + + NORMALIZE_LOCALE(loc); + return (__wcwidth_l(wc, loc)); }