diff -pruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c --- paps-0.6.6.orig/src/paps.c 2007-01-23 18:56:04.000000000 +0900 +++ paps-0.6.6/src/paps.c 2007-01-23 18:59:15.000000000 +0900 @@ -25,6 +25,7 @@ #include #include "libpaps.h" #include +#include #include #include #include @@ -324,6 +325,9 @@ int main(int argc, char *argv[]) int max_width = 0, w; GIConv cvh = NULL; + /* Set locale from environment. */ + setlocale(LC_ALL, ""); + /* Prerequisite when using glib. */ g_type_init(); @@ -451,6 +455,15 @@ int main(int argc, char *argv[]) g_object_unref (G_OBJECT (fontmap)); } + if (encoding == NULL) + { + encoding = g_strdup(nl_langinfo(CODESET)); + if (!strcmp(encoding, "UTF-8")) + { + g_free(encoding); + encoding = NULL; + } + } if (encoding != NULL) { cvh = g_iconv_open ("UTF-8", encoding);