Skip to content
Snippets Groups Projects
Commit adaf8a60 authored by Yorhel's avatar Yorhel
Browse files

Call setlocale() at initialization

This (in combination with linking to ncursesw) fixes the display of
non-ASCII characters.
parent 783993db
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ git - ? ...@@ -7,6 +7,7 @@ git - ?
- Return to previously opened directory on failed recalculation - Return to previously opened directory on failed recalculation
- Properly display MiB units instead of MB (IEEE 1541 - bug #2831412) - Properly display MiB units instead of MB (IEEE 1541 - bug #2831412)
- Link to ncursesw when available - Link to ncursesw when available
- Improved support for non-ASCII characters
1.5 - 2009-05-02 1.5 - 2009-05-02
- Fixed incorrect apparent size on directory refresh - Fixed incorrect apparent size on directory refresh
......
...@@ -24,3 +24,6 @@ Small list of planned features/changes, suggestions are always welcome. ...@@ -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 This should be both more intuitive and more correct than simply
counting a semi-random occurence and ignoring others, as we do now. 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 ...@@ -11,7 +11,7 @@ AC_PROG_RANLIB
# Check for header files. # Check for header files.
AC_CHECK_HEADERS( 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])) AC_MSG_ERROR([required header file not found]))
# Check for typedefs, structures, and compiler characteristics. # Check for typedefs, structures, and compiler characteristics.
...@@ -21,7 +21,7 @@ AC_STRUCT_ST_BLOCKS ...@@ -21,7 +21,7 @@ AC_STRUCT_ST_BLOCKS
# Check for library functions. # Check for library functions.
AC_CHECK_FUNCS( 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])) AC_MSG_ERROR([required function missing]))
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/time.h> #include <sys/time.h>
#include <locale.h>
int pstate; int pstate;
...@@ -146,6 +147,8 @@ char *argv_parse(int argc, char **argv) { ...@@ -146,6 +147,8 @@ char *argv_parse(int argc, char **argv) {
int main(int argc, char **argv) { int main(int argc, char **argv) {
char *dir; char *dir;
setlocale(LC_ALL, "");
if((dir = argv_parse(argc, argv)) == NULL) if((dir = argv_parse(argc, argv)) == NULL)
dir = "."; dir = ".";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment