Call setlocale() at initialization
This (in combination with linking to ncursesw) fixes the display of non-ASCII characters.
Этот коммит содержится в:
родитель
783993dbf5
Коммит
adaf8a6098
@ -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
|
||||
|
3
TODO
3
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()
|
||||
|
||||
|
@ -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]))
|
||||
|
||||
|
||||
|
@ -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 = ".";
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user