Flexible encoding and support of locale paper size
[enscript.git] / src / util.c
index a3814c1b37bf5456807fab6a4908338a384cb06d..4fca6e4ddc12aed0717c9a75031bb8aa6d2b03a1 100644 (file)
@@ -171,6 +171,16 @@ read_config (char *path, char *file)
        {
          token2 = GET_TOKEN (NULL);
          CHECK_TOKEN ();
+#ifdef LC_PAPER
+         if (!strcasecmp("LC_PAPER", token2))
+           {
+             unsigned int paperheight = (unsigned int)nl_langinfo(_NL_PAPER_HEIGHT);
+             if (paperheight && paperheight == 279)
+               token2 = "letter";
+             else
+               token2 = "a4";
+           }
+#endif
          xfree (media_name);
          media_name = xstrdup (token2);
        }