diff -Nur pilot-link.0.9.5-bak/libsock/util.c pilot-link.0.9.5/libsock/util.c --- pilot-link.0.9.5-bak/libsock/util.c Mon Dec 10 08:21:10 2001 +++ pilot-link.0.9.5/libsock/util.c Mon Dec 10 21:04:27 2001 @@ -29,7 +29,7 @@ #include #endif -#define PILOT_CHARSET "CP1252" +#define DEFAULT_PILOT_CHARSET "CP1252" /*********************************************************************** * @@ -51,8 +51,13 @@ iconv_t cd; char *ib, *ob; size_t ibl, obl; + char *charset_env; - cd = iconv_open(PILOT_CHARSET, charset); + charset_env = getenv("PILOTCHARSET"); + if (charset_env) + cd = iconv_open(charset_env, charset); + if (!charset_env || !cd) + cd = iconv_open(DEFAULT_PILOT_CHARSET, charset); if (!cd) return -1; @@ -92,8 +97,13 @@ iconv_t cd; char *ib, *ob; size_t ibl, obl; + char *charset_env; - cd = iconv_open(charset, PILOT_CHARSET); + charset_env = getenv("PILOTCHARSET"); + if (charset_env) + cd = iconv_open(charset, charset_env); + if (!charset_env || !cd) + cd = iconv_open(charset, DEFAULT_PILOT_CHARSET); if (!cd) return -1;