diff --git a/main.c b/main.c index 5f0a9eb..c409d0a 100644 --- a/main.c +++ b/main.c @@ -65,6 +65,7 @@ * */ +#include #include #include #include @@ -140,6 +141,8 @@ int main(int argc, char **argv) int errflag; /* C error processing? */ bname_t bname ; /* buffer name of file to read */ + setlocale( LC_CTYPE, "") ; /* wide character support (UTF-32) */ + #if PKCODE & BSD sleep(1); /* Time for window manager. */ #endif diff --git a/utf8.c b/utf8.c index 181f6ac..f06b7ac 100644 --- a/utf8.c +++ b/utf8.c @@ -11,8 +11,12 @@ * Display width of UTF-8 character */ unsigned utf8_width( unicode_t c) { +#ifdef CYGWIN assert( sizeof( wchar_t) == 2) ; /* wcwidth only handle UTF-16 */ return (c < 0x10000) ? (unsigned) wcwidth( (wchar_t) c) : 2 ; +#else + return (unsigned) wcwidth( (wchar_t) c) ; +#endif } /*