diff --git a/ChangeLog b/ChangeLog index dd3b0cfe7dea15b963ac3d30e09fa3add7c0b8bd..8c71264bdcb47342e64ac55c11e8295037f1e921 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ git - ? - Return to previously opened directory on failed recalculation - Properly display MiB units instead of MB (IEEE 1541 - bug #2831412) - Link to ncursesw when available + - Improved support for non-ASCII characters 1.5 - 2009-05-02 - Fixed incorrect apparent size on directory refresh diff --git a/TODO b/TODO index 8ed7a89df3fc14a7c9d242912e0f3f18c3716282..6c1060127335606a8202dd51a7c00b36f96ca331 100644 --- a/TODO +++ b/TODO @@ -24,3 +24,6 @@ Small list of planned features/changes, suggestions are always welcome. This should be both more intuitive and more correct than simply counting a semi-random occurence and ignoring others, as we do now. +- Better handling of multibyte or multicolumn characters + * strlen() <> number_of_columns() <> number_of_characters() + diff --git a/configure.in b/configure.in index 18487a78e5714235fb18187f540d92fb60479a92..c4ee13e3e33371764904ca32e0ff8226580c5924 100644 --- a/configure.in +++ b/configure.in @@ -11,7 +11,7 @@ AC_PROG_RANLIB # Check for header files. AC_CHECK_HEADERS( - [limits.h stdlib.h string.h sys/time.h sys/types.h sys/stat.h dirent.h unistd.h fnmatch.h ncurses.h],[], + [limits.h stdlib.h string.h sys/time.h sys/types.h sys/stat.h dirent.h unistd.h fnmatch.h ncurses.h locale.h],[], AC_MSG_ERROR([required header file not found])) # Check for typedefs, structures, and compiler characteristics. @@ -21,7 +21,7 @@ AC_STRUCT_ST_BLOCKS # Check for library functions. AC_CHECK_FUNCS( - [getcwd gettimeofday memset fnmatch chdir rmdir unlink lstat getcwd],[], + [getcwd gettimeofday memset fnmatch chdir rmdir unlink lstat getcwd setlocale],[], AC_MSG_ERROR([required function missing])) diff --git a/src/main.c b/src/main.c index d3f22d697b21dd9164bbcf55b5a04f6b3be448d3..697c1e291bfb2c2965a77c0cd188424e47da0a4d 100644 --- a/src/main.c +++ b/src/main.c @@ -31,6 +31,7 @@ #include <unistd.h> #include <sys/time.h> +#include <locale.h> int pstate; @@ -146,6 +147,8 @@ char *argv_parse(int argc, char **argv) { int main(int argc, char **argv) { char *dir; + setlocale(LC_ALL, ""); + if((dir = argv_parse(argc, argv)) == NULL) dir = ".";